>
? gt; _functions.php:
lt ;? phpgetCurrentYear () {date («Y»);
} addSuffixToNumerals ($ num, $ word, $ closure) {
$ one_num=last_int ($ num, 1);
$ two_num=last_int ($ num, 2);
$ finalClose=$ closure [0]; ($ one_num gt;=2 amp; amp; $ one_num lt;=4) {
$ finalClose=$ closure [1];
} ($ one_num gt;=5 amp; amp; $ one_num lt;=9 || $ one_num == 0 || $ two_num gt;=10 amp; amp; $ two_num lt;= 20) {
$ finalClose=$ closure [2];
} $ word. $ finalClose;
} last_int ($ num, $ numSimbol) {
$ result=(int) substr ($ num, strlen ($ num) - $ numSimbol, strlen ($ num)); $ result;
} getValue ($ postValue, $ getValue) {_dump ($ postValue); _ dump ($ getValue);
} getTemplate ($ template) {($ template == «) {
$ tempTemplate= index raquo ;;
} ($ template == poster || $ template == content || $ template == basket || $ template == search || $ template == profile ) {
$ tempTemplate=$ template;
} $ tempTemplate;
} returnURL ($ href, $ type= ) {
$ resultURL=HOME_PAGE_LINK;
$ linkArr=array (); ($ type!=«) {
$ linkArr []=$ type;
} ($ href!=«) {
$ linkArr []=$ href;
} (count ($ linkArr) gt; 0) {
$ resultURL=implode (/ raquo ;, $ linkArr);
$ resultURL=HOME_PAGE_LINK. $ resultURL;
} $ resultURL;
} createBreadCrumb ($ template, $ link=«, $ posterName =«, $ type=«) {
$ resultArr=array ();
$ resultArr []=createATag ( lt; strong gt; lt;/strong gt; ); ($ template) { content : ($ type) { contact raquo ;:
$ resultArr []= lt; span gt; lt;/span gt; raquo ;;;
case production :
$ resultArr []= lt; span gt; lt;/span gt; raquo ;;;
}; search :
$ resultArr []= lt; span gt; lt;/span gt; raquo ;;; poster : ($ link!=«) {
$ catInfo=getCurrentCategoryInfo ($ link); ($ posterName == «) {
$ resultArr []= lt; span gt; . $ catInfo [ header ]. lt;/span gt; raquo ;;
} {
$ resultArr []=createATag ($ catInfo [ header ], $ catInfo [ link ], poster );
$ resultArr []= lt; span gt; # . $ posterName. « Lt;/span gt;»;
}
};
}
$ result=implode ( lt; span gt;/ lt;/span gt; raquo ;, $ resultArr); $ result;
} createTitle ($ template, $ link=«, $ posterName =«, $ type=«) {
$ resultArr= raquo ;; ($ template) { content : ($ type) { contact :
$ resultArr= raquo ;;; production :
$ resultArr= raquo ;;;
}; search :
$ resultArr= raquo ;;; poster : ($ link!=«) {
$ catInfo=getCurrentCategoryInfo ($ link);
$ resultArr=$ catInfo [ header ];
}
break;
}
$ result=$ resultArr;
return $ result;
} add_recently_watch ($ poster_id) {(! empty ($ _ COOKIE [ recently ])) {
$ next_step=count ($ _COOKIE [ recently ]); (! in_array ($ poster_id, $ _COOKIE [ recently ])) {(«recently [$ next_step]», $ poster_id, time () + 360000000, /);
}
} {(«recently [0]», $ poster_id, time () + 360000000, /);
}
} addMesage ($ status, $ text) {
$ classMessage=$ status;
$ _ SESSION [ service_message ]=« lt; div gt;
} writeMessage () {$ _SESSION [ service_message ];
$ _ SESSION [ service_message ]=«;
} currentEmail ($ email) {true;
}
? gt; .php:
lt ;? php
$ config=array (
css = gt; array (
style.css ,
main_banner.css ,
content_page.css ...