day, %b -> short month, %G -> 4digit year; for all possibilities have a look at http://www.php.net/manual/de/function.strftime.php $datelang = "en_US"; // language for formatted date output, de_DE -> german formatting; see http://www.php.net/manual/de/function.setlocale.php // WYSIWYG editor settings $pathtoscript = ""; // path from the file where mynews.inc.php is included to the folder where mynews.inc.php is actually stored in // with trailing slash if set! $wysiwyg = true; // turn wysiwyg editor on/off $filesPathFromDocRoot = "news/files/"; // Path to the folder where all uploaded files from FCKeditor are saved. Relative to the document root. with trailing slash! // language setttings $txtsign = "Добави новина"; // menu item text $txtview = "Виж новините"; // menu item text $txtadmin = "admin"; $txtlogout = "изход"; $txtbadtitle = "Липсващо заглавие"; $txtbadstory = "Липсваща историйка"; $txtbadteaser = "Празно поле"; $txtbaddate = "Липсваща дата"; $txtclickback = "Кликни BACK в браузера!"; $txterrors = "Поличи се следната грешка:"; $txtedit = "Едит"; $txtdelete = "Изтрий"; $txtoptional = "По желание"; // RSS 0.9 settings $rssEnable = true; // set to true if you want to offer rss feed of your news $rssTitle = "Новините на Олег"; // Title of teh RSS feed $rssDescription = "Get the lates news from my very interesting site!"; // Description of RSS feed $rssChannelUrl = "http://www.mysite.com"; // Base URL of your Site (doesn't really matter) $rssNewspageUrl = "http://shark.vc-tech.net/auto/news.php"; // URL of the site where you did the 'mynews.inc.php'-include $rssNumNews = 5; // Number of News to display in the rss feed $rssOrder = "ASC"; // order of news in the feed: ASC/DESC // ************************** STYLE DEFs ********************** // ************************************************************ if ($_REQUEST['mndo']!="rss" && $fromFCK !== true){ ?> sortkeys[$i][0]],$b[$this->sortkeys[$i][0]]); if ($this->sortkeys[$i][1] == "DESC") $r = $r * -1; if($r==0) { $i++; if ($this->sortkeys[$i]) $r = $this->_sortcmp($a, $b, $i); } return $r; } function msort() { if(count($this->sortkeys)) { usort($this->data,array($this,"_sortcmp")); } } } ?> sortkeys = array(array('time','DESC')); if (count($foo)==0){ $empty=true; $nextindex=1; }else{ $i=0; foreach ($foo as $line){ $line=explode("|", rtrim($line)); if ($line[2]=="static" || ($line[2]=="dynamic" && $line[1]<$now) || isloggedin() ){ $stuff->data[$i] = array("id" => $line[0], "time" => $line[1], "mode" => $line[2], "title" => $line[3], "story" => $line[4], "teaser" => $line[5]); $i++; } } if ($i>0){ $stuff->sortkeys = array(array('id','DESC')); $stuff->msort(); $foo=current($stuff->data); $nextindex=$foo['id']+1; $stuff->sortkeys = array(array('time','DESC')); $stuff->msort(); $numposts=count($stuff->data); }else{ $numposts=0; $empty=true; } } // RSS stuff if ($rssEnable){ $info = pathinfo($_SERVER['PHP_SELF']); $info['dirname'] = ($info['dirname'] == "/") ? $info['dirname'] : $info['dirname']."/"; $url = $info['dirname'].$pathtoscript."rss.php?mndo=rss"; echo ""; } echo "\n\n\n\n"; echo "
"; clearoldadmins(); // admin stuff if ($do=="admin") { if ($action=="login"){ if ($name==$adminname && $pwd==$adminpwd){ include($log); $fp=fopen($log, "w"); fputs($fp, "0){ foreach ($admins as $line){ fputs($fp, "\$admins[$i]['time']=".$line[time]."; \$admins[$i]['hash']='".$line['hash']."';\n"); $i++; } } fputs($fp, "\$admins[$i]['time']=".$now."; \$admins[$i]['hash']='".md5($hash)."';\n?>"); fclose($fp); jsRedirect($me.$getvars); } } if ($action=="delete" && isloggedin()){ $todel=getkey($id, $stuff); unset($stuff->data[$todel]); $stuff->msort(); saveposts($stuff->data); $do="view"; }else{ ?>
Админ Панелче

Име  
Парола  
 
» $txtbadtitle"; //if ($story=="") $error.="
» $txtbadstory"; if ($teaser=="") $error.="
» $txtbadteaser"; if ($date=="") $error.="
» $txtbaddate"; if ($error===false){ $date = explode(".", $date); $daytime = explode(".", $_REQUEST['daytime']); $daytime[0] = (is_numeric($daytime[0]) && $daytime[0] >= 0 && $daytime[0] < 24) ? $daytime[0] : 23; $daytime[1] = (is_numeric($daytime[1]) && $daytime[1] >= 0 && $daytime[1] < 60) ? $daytime[1] : 59; $time = mktime($daytime[0], $daytime[1], 0, $date[1], $date[0], $date[2]); $story = ($_REQUEST['hasstory'] == 1) ? $_REQUEST['story'] : ""; if ($id=="new"){ $index=$numposts; $id=$nextindex; $saveit=true; }else if (is_numeric($id)){ $index=getkey($id, $stuff); $saveit=true; } if ($saveit){ $stuff->data[$index]['id']=$id; $stuff->data[$index]['time']=$time; $stuff->data[$index]['mode']=$_REQUEST['mode']; $stuff->data[$index]['title']=str_replace(array("|"), array(" "), $title); if ($wysiwyg===true){ $stuff->data[$index]['teaser']=stripslashes(str_replace(array("\r", "\n", "|"), array(" ", " ", " "), $teaser)); $stuff->data[$index]['story']=stripslashes(str_replace(array("\r", "\n", "|"), array(" ", " ", " "), $story)); }else{ $stuff->data[$index]['teaser']=str_replace(array("\r", "\n", "|"), array(" ", "
", " "), $teaser); $stuff->data[$index]['story']=str_replace(array("\r", "\n", "|"), array(" ", "
", " "), $story); } saveposts($stuff->data); $stuff->msort(); $empty=false; } $do="view"; }else echo "
$txterrors$error

$txtclickback
"; }else{ if ($action=="edit"){ $post=$stuff->data[getkey($id, $stuff)]; $title= htmlentities(stripslashes($post['title']), ENT_QUOTES); if ($wysiwyg===true){ $teaser = ($post['teaser']); $story = ($post['story']); }else{ $teaser=stripslashes(str_replace("
", "\n", htmlentities($post['teaser'], ENT_QUOTES))); $story=stripslashes(str_replace("
", "\n", htmlentities($post['story'], ENT_QUOTES))); } $time=$post['time']; $mode = $post['mode']; $hasstory = (trim($story) != "") ? true : false; }else{ $title=""; $story=""; $time="notset"; $id="new"; $mode = "dynamic"; $hasstory = true; } ?>
Date  [dd.mm.yyyy]    [hh.mm]
Mode 
     
dynamic = news aren't shown when date is in future
static = news are always shown
Title 
Teaser 
BasePath = $pathtoscript.'FCKeditor/'; $oFCKeditor->Value = $teaser; $oFCKeditor->Width = "100%"; $oFCKeditor->Height = 300; $oFCKeditor->Create() ; } else { ?>
 
Story 
BasePath = $pathtoscript.'FCKeditor/'; $oFCKeditor->Value = $story; $oFCKeditor->Width = "100%";; $oFCKeditor->Height = 450; $oFCKeditor->Create() ; } else { ?>
 
data[getkey($_GET['mnid'], $stuff)]; $item['title'] = stripslashes($item['title']); $item['teaser'] = stripslashes($item['teaser']); $item['story'] = stripslashes($item['story']); if ($wrap!==false) $item['story']=wordwrap($item['story'], $wrap, " ", 1); $match=array("{title}", "{time}", "{teaser}", "{story}", "{edit}", "{delete}", "{urltoallnews}"); if (isloggedin()){ $replace=array( $item['title'], strftime($dateformat, $item['time']), $item['teaser'], $item['story'], "$txtedit", "$txtdelete", "$me$getvars&page=".$_GET['page']); }else $replace=array($item['title'], strftime($dateformat, $item['time']), $item['teaser'], $item['story'], "", "", "$me$getvars&page=".$_GET['page']); $tmp = str_replace($match, $replace, $tpl_story); ob_start(); eval("?>".$tmp."data as $item){ if ($item['id']!=0 && $i>=$from && $i< ($from+$ppp) ){ $item['title'] = stripslashes($item['title']); $item['teaser'] = stripslashes($item['teaser']); $item['story'] = stripslashes($item['story']); $hasstory = (trim($item['story']) != "") ? true : false; if ($wrap!==false) $item['story']=wordwrap($item['story'], $wrap, " ", 1); $match=array("{title}", "{time}", "{teaser}", "{story}", "{edit}", "{delete}", "{urltofullstory}"); if (isloggedin()){ $replace=array( $item['title'], strftime($dateformat, $item['time']), $item['teaser'], $item['story'], "$txtedit", "$txtdelete", ($hasstory === true) ? "$me$getvars&mnid=".$item['id']."&page=".$_GET['page'] : "" ); }else{ $replace = array($item['title'], strftime($dateformat, $item['time']), $item['teaser'], $item['story'], "", "", ($hasstory === true) ? "$me$getvars&mnid=".$item['id']."&page=".$_GET['page'] : "" ); } $tmp = str_replace($match, $replace, $tpl_teaser); ob_start(); eval("?>".$tmp."0) ? floor($numposts/$ppp)+1 : ($numposts/$ppp); echo "

"; echo paging($numpages); echo "

"; } } } // closing table tags // Please don't remove the 'powered by...' link echo "
"; if (!isloggedin()) echo "$txtadmin"; else echo "$txtlogout "; echo "
"; echo "\n\n\n\n"; ?>
Магазин за автоключове и консумативи