PageRenderTime 64ms CodeModel.GetById 21ms RepoModel.GetById 0ms app.codeStats 0ms

/addons/paged_archive.php

https://github.com/aravindc/pixelpost
PHP | 846 lines | 628 code | 113 blank | 105 comment | 137 complexity | cf9d5a24ee5ff759fbe2b51dc534b2b8 MD5 | raw file
Possible License(s): GPL-2.0
  1. <?php
  2. // SVN file version:
  3. // $Id$
  4. /*
  5. Pixelpost version 1.7.1
  6. Pixelpost www: http://www.pixelpost.org/
  7. Version 1.7.1:
  8. Development Team:
  9. Ramin Mehran, Will Duncan, Joseph Spurling,
  10. Piotr "GeoS" Galas, Dennis Mooibroek, Karin Uhlig, Jay Williams, David Kozikowski
  11. Former members of the Development Team:
  12. Connie Mueller-Goedecke
  13. Version 1.1 to Version 1.3: Linus <http://www.shapestyle.se>
  14. Originally written by: Ramin Mehran
  15. ============================================================================
  16. NEW TAGS:
  17. <CATEGORY_LINKS_AS_LIST> // Category links as a text list for default PP's archive page
  18. <CATEGORY_LINKS_AS_LIST_PAGED> // Category links as a text list for page-by-page archive
  19. <BROWSE_MONTHLY_ARCHIVE_PAGED> // Monthly drop box for default PP's archive page
  20. <BROWSE_MONTHLY_ARCHIVE_AS_LINK_PAGED> // Monthly links as a text list for page-by-page archive
  21. <BROWSE_CATEGORIES_PAGED> // Category drop box for page-by-page archive
  22. <THUMBNAILS_WHOLE_PAGED> // Thumbnails in this page
  23. <THUMBNAILS_PAGES_LINKS> // Link to the pages of thumbnail in the selected category
  24. <ARCHIVE_PAGES_NUM> // Page number you are viewing
  25. <CATEGORY_OR_DATE_NAME_PAGED_ARCHIVE> // Name of the category or Month you select
  26. <LINK_TO_PAGED_ARCHIVE> // Link to Paged-by-page archive page as <a href="index.php?x=browse&pagenum=1">Archive</a>',$tpl);
  27. <TAG_LINKS_AS_LIST> // Tag links as a text list for default PP's archive page
  28. <TAG_LINKS_AS_LIST_PAGED> // Tag links as a text list for page-by-page archive
  29. <FOCUS_TAG_LINKS_AS_LIST> // Like <TAG_LINKS_AS_LIST> but with reverse font-size (css)
  30. <FOCUS_TAG_LINKS_AS_LIST_PAGED> // Like <TAG_LINKS_AS_LIST_PAGED> but with reverse font-size (css)
  31. <TAG_IMG_LIST> // list of tags for showed image
  32. <TAG_IMG_LIST_PAGED> // list of tags for showed image
  33. <TAG_IMG_LIST_KEYWORDS> // list of tags for showed image for use as Keywords in Meta Tag
  34. <TAG_LINKS_AS_LIST_NO_NUM> // Like <TAG_LINKS_AS_LIST> but without number of photos for this tag
  35. <TAG_LINKS_AS_LIST_PAGED_NO_NUM> // Like <TAG_LINKS_AS_LIST_PAGED> but without number of photos for this tag
  36. <FOCUS_TAG_LINKS_AS_LIST_NO_NUM> // Like <FOCUS_TAG_LINKS_AS_LIST> but without number of photos for this tag
  37. <FOCUS_TAG_LINKS_AS_LIST_PAGED_NO_NUM> // Like <FOCUS_TAG_LINKS_AS_LIST_PAGED> but without number of photos for this tag
  38. */
  39. $addon_name = "Page-By-Page-Archive for category and month";
  40. $addon_version = "1.7";
  41. global $default_language_abr, $language_abr, $PP_supp_lang, $cdate, $image_id, $tpl;
  42. $maxpthumb = $cfgrow['maxpthumb'];
  43. if ($cfgrow['display_order']=='default') $display_order = 'DESC';
  44. else $display_order = 'ASC';
  45. if (isset($_GET['updatedflagp'])&&$_GET['updatedflagp']=="1") $isupdated = "<font color='#FF0000'>Updated!</font>";
  46. else $isupdated = "";
  47. if ($language_abr == $default_language_abr) $headline_selection = 'headline';
  48. else $headline_selection = 'alt_headline';
  49. // FIELD_EXISTS
  50. // Checks whether specified field exists in current or specified table.
  51. $fieldname = "maxpthumb";
  52. $table = $pixelpost_db_prefix ."config";
  53. $fieldexists = 0;
  54. $t = 0;
  55. $attention_call = "";
  56. if ($table != "")
  57. {
  58. if(isset($table_name))
  59. {
  60. $current_table = $table;
  61. }
  62. $result_id = mysql_list_fields( $pixelpost_db_pixelpost, $table);
  63. for($t = 0; $t < mysql_num_fields($result_id); $t++)
  64. {
  65. if (strtolower( $fieldname) == strtolower(mysql_field_name($result_id, $t)))
  66. {
  67. $fieldexists = 1;
  68. break;
  69. }
  70. }
  71. }
  72. // if the field does not exit: Create it!
  73. if($fieldexists==0)
  74. {
  75. $result = mysql_query("ALTER TABLE $table ADD `maxpthumb` VARCHAR( 5) DEFAULT '100' NOT NULL ");
  76. }
  77. // if the maximum number of thumbnails in the admin section is updated
  78. if(isset($_GET['x'])&&$_GET['x'] == "maxpthumb")
  79. {
  80. $newmaxpthumb = (int) $_POST['newmaxpthumb'];
  81. $query = "update ".$pixelpost_db_prefix."config set maxpthumb='" .$newmaxpthumb ."'" ;
  82. $update = mysql_query($query);
  83. };
  84. // description
  85. $addon_description = "$attention_call Page by page category and month archive. Useful when you have
  86. plenty of photos in archive and you want to show them in few pages and not just as a whole.
  87. Many new tags is added to handle the archives. Open the archive_page.php file to see the new tags.<p />
  88. Enter the maximum number of thumbnails in each page of the archive page:
  89. <form method='post' action='index.php?view=addons&amp;x=maxpthumb'>
  90. <input type='text' name='newmaxpthumb' value='".$maxpthumb ."' style='width:40px'>
  91. <input type='submit' value='update'>
  92. </form> $isupdated
  93. <p>TAGS:<br/>
  94. <br/>
  95. &lt;CATEGORY_LINKS_AS_LIST&gt; // Category links as a text list for default PP's
  96. archive page<br/>
  97. &lt;CATEGORY_LINKS_AS_LIST_PAGED&gt; // Category links as a text list for page-by-page
  98. archive<br/>
  99. &lt;BROWSE_MONTHLY_ARCHIVE_PAGED&gt; // Monthly drop box for default PP's archive page<br/>
  100. &lt;BROWSE_MONTHLY_ARCHIVE_AS_LINK_PAGED&gt; // Monthly links as a text list for
  101. page-by-page archive<br/>
  102. &lt;BROWSE_CATEGORIES_PAGED&gt; // Category drop box for page-by-page archive<br/>
  103. &lt;THUMBNAILS_WHOLE_PAGED&gt; // Thumbnails in this page<br/>
  104. &lt;THUMBNAILS_PAGES_LINKS&gt; // Link to the pages of thumbnail in the selected
  105. category<br/>
  106. &lt;ARCHIVE_PAGES_NUM&gt; // Page number you are viewing<br/>
  107. &lt;CATEGORY_OR_DATE_NAME_PAGED_ARCHIVE&gt; // Name of the category or Month you
  108. select<br/>
  109. &lt;LINK_TO_PAGED_ARCHIVE&gt; // Link to Paged-by-page archive page</p>
  110. <p>NEW TAGS:<br/>
  111. <br/>
  112. &lt;TAG_LINKS_AS_LIST&gt; // Tag links as a text list for default PP's archive page (different font-size by css)<br/>
  113. &lt;TAG_LINKS_AS_LIST_PAGED&gt; // Tag links as a text list for page-by-page archive (different font-size by css)<br/>
  114. &lt;FOCUS_TAG_LINKS_AS_LIST&gt; // Like &lt;TAG_LINKS_AS_LIST&gt; but with reverse font-size (css)<br />
  115. &lt;FOCUS_TAG_LINKS_AS_LIST_PAGED&gt; // Like &lt;TAG_LINKS_AS_LIST_PAGED&gt; but with reverse font-size (css)<br />
  116. &lt;TAG_IMG_LIST&gt; // list of tags for showed image<br/>
  117. &lt;TAG_IMG_LIST_PAGED&gt; // list of tags for showed image<br />
  118. &lt;TAG_IMG_LIST_KEYWORDS&gt; // list of tags for showed image for use as Keywords in Meta Tag<br />
  119. &lt;TAG_LINKS_AS_LIST_NO_NUM&gt; // Like &lt;TAG_LINKS_AS_LIST&gt; but without number of photos for this tag<br />
  120. &lt;TAG_LINKS_AS_LIST_PAGED_NO_NUM&gt; // Like &lt;TAG_LINKS_AS_LIST_PAGED&gt; but without number of photos for this tag<br/>
  121. &lt;FOCUS_TAG_LINKS_AS_LIST_NO_NUM&gt; // Like &lt;FOCUS_TAG_LINKS_AS_LIST&gt; but without number of photos for this tag<br />
  122. &lt;FOCUS_TAG_LINKS_AS_LIST_PAGED_NO_NUM&gt; // Like &lt;FOCUS_TAG_LINKS_AS_LIST_PAGED&gt; but without number of photos for this tag<br /></p>
  123. ";
  124. // date time of now!
  125. $tz = $cfgrow['timezone'];
  126. $datetime = gmdate("Y-m-d H:i:s",gmdate("U")+(3600 * $tz));
  127. // get maximum number of thumbnails in each browse page from db
  128. $maxnumber_thumbs = $cfgrow['maxpthumb'];
  129. // number of all photos
  130. $photonumb = mysql_query("SELECT count(*) AS count FROM ".$pixelpost_db_prefix."pixelpost WHERE datetime<='$datetime'");
  131. $row = mysql_fetch_array($photonumb,MYSQL_ASSOC);
  132. // number of photos in the database
  133. $pixelpost_all_photonumb = $row['count'] ;
  134. if (isset($_GET['tag'])){
  135. $_GET['tag'] = ($_GET['tag']) ? urldecode($_GET['tag']) : '';
  136. }
  137. $_GET['category'] = (isset($_GET['category']) && $_GET['category'] > 0) ? (int)$_GET['category'] : "";
  138. if(isset($_GET['tag']) && preg_match("/([a-zA-Z 0-9_-\pL]+)/u",$_GET['tag'])) $paged_arch_tag_flag = 1;
  139. else if(isset($_GET['tag']) && preg_match("/([a-zA-Z 0-9_-]+)/",$_GET['tag'])) $paged_arch_tag_flag = 2;
  140. else $paged_arch_tag_flag = 0;
  141. if(isset($_GET['archivedate']) && eregi("^[0-9]{4}-[0-9]{2}$", $_GET['archivedate'])) $paged_arch_archdate_flag = 1;
  142. else $paged_arch_archdate_flag = 0;
  143. // Browse images monthly
  144. $bryear = (isset($_GET['bryear'])) ? (int)$_GET['bryear'] : '';
  145. $brmonth = (isset($_GET['brmonth'])) ? (int)$_GET['brmonth'] : '';
  146. $brbrowse = ($bryear > 0 && $brmonth > 0) ? 1 : 0;
  147. //-------------------------------- Category Browse Menu (paged and original)
  148. /*---------------------------------**********************---------------------------------------*/
  149. $count= $pixelpost_all_photonumb;
  150. $category_Link_List = " <a href='index.php?x=browse'> $lang_browse_all (" .$count .") </a><br />";
  151. $category_Link_List_paged = "<ul id=\"taglist\">";
  152. $category_Link_List_paged .= "<li><a href='index.php?x=browse&amp;pagenum=1'>$lang_browse_all (" .$count .")</a></li>";
  153. if ($language_abr == $default_language_abr) $query = mysql_query("SELECT * FROM ".$pixelpost_db_prefix."categories ORDER BY name");
  154. else $query = mysql_query("SELECT * FROM ".$pixelpost_db_prefix."categories ORDER BY alt_name");
  155. while(list($id, $name, $alt_name) = mysql_fetch_row($query))
  156. {
  157. $queryr = "SELECT count(*) AS count,datetime
  158. FROM {$pixelpost_db_prefix}catassoc AS t1
  159. INNER JOIN {$pixelpost_db_prefix}pixelpost t2 on t2.id = t1.image_id
  160. WHERE (t1.cat_id = '".$id."' AND datetime<='$datetime')
  161. GROUP BY t1.cat_id ";
  162. $count = mysql_query($queryr);
  163. $count = mysql_fetch_array($count,MYSQL_ASSOC);
  164. $count= $count['count'];
  165. if ($count > 0){
  166. if($language_abr == $default_language_abr) $name = pullout($name);
  167. else $name = pullout($alt_name);
  168. $catname_count = $name ." (" .$count .")";
  169. $category_Link_List .= "<a href='index.php?x=browse&amp;category=$id'>$catname_count</a><br />";
  170. // paged version of the browse archive
  171. $category_Link_List_paged .= "<li><a href='index.php?x=browse&amp;category=$id&amp;pagenum=1'>$catname_count</a></li>";
  172. }
  173. }
  174. $category_Link_List_paged .= "</ul>";
  175. //----------- Monthly Archive Menu and List
  176. if (isset($_GET['pagenum'])&&$_GET['pagenum'] != "")
  177. {
  178. $tz = $cfgrow['timezone'];
  179. $thismonth = gmdate("Y-m",gmdate("U")+(3600 * $tz));
  180. $select_display_thismonth=date("F, Y",strtotime($thismonth."-01"));
  181. $archive_select = "<select name='browse' onchange='self.location.href=this.options[this.selectedIndex].value;'><option value=''>Monthly archive</option><option value='index.php?x=browse&amp;pagenum=1'>$lang_browse_all (" .$pixelpost_all_photonumb .")</option>";
  182. $archive_select_links = "<ul id=\"monthlist\">
  183. <li><a href='index.php?x=browse&amp;pagenum=1'>$lang_browse_all (" .$pixelpost_all_photonumb .")</a></li>";
  184. $query = "SELECT distinct DATE_FORMAT(datetime, '%Y-%m') FROM ".$pixelpost_db_prefix."pixelpost
  185. WHERE DATE_FORMAT(datetime, '%Y-%m') <= '$thismonth' and datetime<='$datetime'
  186. ORDER BY datetime desc";
  187. $query = mysql_query($query);
  188. while(list($thedate) = mysql_fetch_row($query))
  189. {
  190. $query2 = "SELECT count(*) AS count FROM ".$pixelpost_db_prefix."pixelpost WHERE datetime<='$datetime' and DATE_FORMAT(datetime, '%Y-%m')='".$thedate ."'";
  191. $count = mysql_query($query2);
  192. $count = mysql_fetch_array($count,MYSQL_ASSOC);
  193. $count= $count['count'];
  194. $select_display_date=date("F, Y",strtotime($thedate."-01"));
  195. $select_display_date2 = ucfirst(${"lang_".strtolower(date("F",strtotime($thedate."-01")))}) . date(", Y",strtotime($thedate."-01"));
  196. $select_display_date_link=str_replace(" ","%20",$select_display_date);
  197. $thedate = pullout($thedate);
  198. preg_match('/(\w+),\s/', $select_display_date, $naturalmonth);
  199. $natmonth = 'lang_'.strtolower($naturalmonth[1]);
  200. $mynatmonth = $$natmonth;
  201. $select_display_date=preg_replace('/\w+,(\s\d+)/', "$mynatmonth$1", $select_display_date);
  202. $archive_select .= "<option value='index.php?x=browse&amp;archivedate=$thedate&amp;monthname=$select_display_date_link&amp;pagenum=1'>$name (" .$select_display_date2 .") (" .$count .")</option>";
  203. $archive_select_links .= "<li><a href='index.php?x=browse&amp;archivedate=$thedate&amp;monthname=$select_display_date_link&amp;pagenum=1'>$name " .$select_display_date2 ." (" .$count .")</a></li>";
  204. };// end while
  205. $archive_select .= "</select>";
  206. $archive_select_links .= "</ul>";
  207. } // end $_GET['pagenum'] != "")
  208. else
  209. {
  210. // does not use page number
  211. $tz = $cfgrow['timezone'];
  212. $thismonth = gmdate("Y-m",gmdate("U")+(3600 * $tz));
  213. $select_display_thismonth=date("F, Y",strtotime($thismonth."-01"));
  214. if (isset($thedate))
  215. {
  216. $archive_select = "<select name='browse' onchange='self.location.href=this.options[this.selectedIndex].value;'><option value=''>Monthly archive</option><option value='index.php?x=browse&amp;archivedate=$thedate&amp;pagenum=1'>$lang_browse_all (" .$pixelpost_all_photonumb .")</option>";
  217. $archive_select_links = "<ul id='monthlist'><li><a href='index.php?x=browse&amp;archivedate=$thedate&amp;pagenum=1'>$lang_browse_all (" .$pixelpost_all_photonumb .")</a></li>";
  218. }
  219. else
  220. {
  221. $archive_select = "<select name='browse' onchange='self.location.href=this.options[this.selectedIndex].value;'><option value=''>Monthly archive</option><option value='index.php?x=browse&amp;pagenum=1'>$lang_browse_all (" .$pixelpost_all_photonumb .")</option>";
  222. $archive_select_links = "<ul id='monthlist'><li><a href='index.php?x=browse&amp;pagenum=1'>$lang_browse_all (" .$pixelpost_all_photonumb .")</a></li>";
  223. }
  224. $query = mysql_query("SELECT DISTINCT DATE_FORMAT(datetime, '%Y-%m') FROM ".$pixelpost_db_prefix."pixelpost ORDER BY datetime desc");
  225. while(list($thedate) = mysql_fetch_row($query))
  226. {
  227. $query3 = "SELECT count(*) AS count FROM ".$pixelpost_db_prefix."pixelpost WHERE DATE_FORMAT(datetime, '%Y-%m')='".$thedate ."'";
  228. $count = mysql_query($query3);
  229. $count = mysql_fetch_array($count,MYSQL_ASSOC);
  230. $count= $count['count'];
  231. $select_display_date=date("F, Y",strtotime($thedate."-01"));
  232. $select_display_date2 = ucfirst(${"lang_".strtolower(date("F",strtotime($thedate."-01")))}) . date(", Y",strtotime($thedate."-01"));
  233. $thedate = pullout($thedate);
  234. $archive_select .= "<option value='index.php?x=browse&amp;archivedate=$thedate'>$name (" .$select_display_date2 .") (" .$count .")</option>";
  235. $archive_select_links .= "<li><a href='index.php?x=browse&amp;archivedate=$thedate'>$name " .$select_display_date2 ." (" .$count .")</a></li>";
  236. }; // end while
  237. $archive_select .= "</select>";
  238. $archive_select_links .= "</ul>";
  239. } // end else
  240. //--------------- check if it should be the browse page
  241. if(isset($_GET['x'])&&$_GET['x'] == "browse")
  242. {
  243. // initialize variables
  244. $thumb_output = "";
  245. $where = "";
  246. $limit = "";
  247. $pagenum = (isset($_GET['pagenum'])) ? (int)$_GET['pagenum'] : 1;
  248. // did user select a category?
  249. if(isset($_GET['category']) && $_GET['category'] != "")
  250. {
  251. $where = "and (t2.cat_id ='".(int)$_GET['category']."')";
  252. }
  253. // do you use links with page number?
  254. if (isset($_GET['pagenum']) && $_GET['pagenum'] != "")
  255. {
  256. $start = $maxnumber_thumbs*((int)$_GET['pagenum']-1);// calculate start and end of the thumbs in the selected page
  257. $limit = " LIMIT $start , $maxnumber_thumbs "; // create the limit command (in MS-SQL this should be TOP)
  258. }// end if ($_GET['pagenum'] != "")
  259. // build query
  260. if (!isset($_GET['archivedate']) && isset($_GET['category']) && $_GET['category'] != "")
  261. {
  262. // no archive date
  263. $query = "SELECT t1.id,t1.{$headline_selection},t1.image
  264. FROM {$pixelpost_db_prefix}pixelpost AS t1, {$pixelpost_db_prefix}catassoc AS t2
  265. WHERE (t1.datetime<='$cdate')
  266. $where
  267. AND (t1.id = t2.image_id)
  268. GROUP BY t1.id
  269. ORDER BY t1.".$cfgrow['display_sort_by']." ".$display_order.$limit;
  270. } // if ($_GET['archivedate']=="")
  271. else if($paged_arch_archdate_flag > 0)
  272. { // archive date is available
  273. $archivedate_start = $_GET['archivedate'] ."-01 00:00:00";
  274. $archivedate_end = $_GET['archivedate'] ."-31 23:59:59";
  275. $query = "SELECT id,{$headline_selection},image FROM ".$pixelpost_db_prefix."pixelpost
  276. WHERE (datetime<='$cdate' and datetime >='$archivedate_start' and datetime <= '$archivedate_end')
  277. $where ORDER BY ".$cfgrow['display_sort_by']." ".$display_order.$limit;
  278. }
  279. else if($paged_arch_tag_flag > 0)
  280. {
  281. if ($language_abr == $default_language_abr) $tag_selection = "AND (t2.tag = '" . $_GET['tag'] . "')";
  282. else $tag_selection = "AND (t2.alt_tag = '" . $_GET['tag'] . "')";
  283. $query = "SELECT t1.id,t1.{$headline_selection},t1.image
  284. FROM {$pixelpost_db_prefix}pixelpost AS t1, {$pixelpost_db_prefix}tags AS t2
  285. WHERE (t1.datetime<='$cdate')
  286. $where
  287. AND (t1.id = t2.img_id)
  288. $tag_selection
  289. GROUP BY t1.id
  290. ORDER BY t1.".$cfgrow['display_sort_by']." ".$display_order.$limit;
  291. }
  292. // Browse images monthly
  293. else if($brbrowse)
  294. {
  295. $query = "
  296. SELECT a.id, a.headline, a.alt_headline, a.image, DATE_FORMAT(a.datetime,'%d.%m.%Y'), count(b.id)
  297. FROM {$pixelpost_db_prefix}pixelpost AS a
  298. LEFT JOIN {$pixelpost_db_prefix}comments AS b ON (b.parent_id = a.id)
  299. WHERE DATE_FORMAT(a.datetime,'%Y%c') = '".$bryear.$brmonth."'
  300. GROUP BY a.id
  301. ORDER BY a.datetime DESC";
  302. }
  303. else
  304. {
  305. $query = "SELECT id, {$headline_selection}, image FROM {$pixelpost_db_prefix}pixelpost
  306. WHERE (datetime<='$cdate')
  307. ORDER BY ".$cfgrow['display_sort_by']." ".$display_order.$limit;
  308. }
  309. $query = mysql_query($query);
  310. //---------------------------- Making thumbs row
  311. // Browse images monthly
  312. if($brbrowse)
  313. {
  314. $thumb_output = "<div id='browse_monthly_imgs'>";
  315. while(list($id,$title,$alt_title,$name,$date,$coms) = mysql_fetch_row($query))
  316. {
  317. // from the thumbnail row. This could be build by tables too.
  318. $title = ($language_abr == $default_language_abr) ? $title : $alt_title;
  319. $title = htmlentities ( pullout($title), ENT_QUOTES, 'UTF-8');
  320. $img = ltrim($cfgrow['imagepath'], "./").$name;
  321. $thumbnail_extra = getimagesize($img);
  322. $local_width = $thumbnail_extra['0'];
  323. $local_height = $thumbnail_extra['1'];
  324. $thumb_output .= "\n<div class='br_mo_img_link'><a href='".PHP_SELF."?showimage=$id' class='br_mo_link' title='$title ($date)'><img src='$img' alt='$title ($date)' class='br_mo_img' width='".$local_width."' height='".$local_height."' /></a></span><br/><span class='br_mo_title'>$title <span class='br_mo_date'>($date)</span> - <span class='br_mo_coms'>$lang_comment_plural: $coms</span></div>";
  325. }
  326. $thumb_output .= "\n</div>";
  327. }
  328. else
  329. {
  330. while(list($id,$title,$name) = mysql_fetch_row($query))
  331. {
  332. // from the thumbnail row. This could be build by tables too.
  333. $title = pullout($title);
  334. $title = htmlspecialchars($title,ENT_QUOTES);
  335. $thumbnail = ltrim($cfgrow['thumbnailpath'], "./")."thumb_".$name;
  336. $thumbnail_extra = getimagesize($thumbnail);
  337. $local_width = $thumbnail_extra['0'];
  338. $local_height = $thumbnail_extra['1'];
  339. $thumb_output .= "<a href='".PHP_SELF."?showimage=$id'><img src='".$thumbnail."' alt='".$title."' title='".$title."' width='".$local_width."' height='".$local_height."' class='thumbnails' /></a>";
  340. } //end while
  341. }
  342. // initialize page counter
  343. $pagecounter=0;
  344. //---------------- Get number of photos in database in the selected category
  345. // initialize where command
  346. $where = "";
  347. $monthname = "";
  348. // check if user selects a category
  349. if(isset($_GET['category'])&&$_GET['category'] != "")
  350. {
  351. $queryr = "SELECT count(*) AS count,datetime
  352. FROM {$pixelpost_db_prefix}catassoc AS t1
  353. INNER JOIN {$pixelpost_db_prefix}pixelpost t2 on t2.id = t1.image_id
  354. WHERE (t1.cat_id = '".(int)$_GET['category']."' AND datetime<='$datetime')";
  355. $queryr .= " GROUP BY t1.cat_id ";
  356. }// end if
  357. else if($paged_arch_tag_flag > 0)
  358. {
  359. if ($language_abr == $default_language_abr) $tag_selection = "AND (t2.tag = '" . mysql_real_escape_string($_GET['tag']) . "')";
  360. else $tag_selection = "AND (t2.alt_tag = '" . mysql_real_escape_string($_GET['tag']) . "')";
  361. $queryr = "SELECT count(*) AS count
  362. FROM {$pixelpost_db_prefix}pixelpost AS t1, {$pixelpost_db_prefix}tags AS t2
  363. WHERE (t1.datetime<='$cdate')
  364. AND (t1.id = t2.img_id)
  365. $tag_selection";
  366. }
  367. else if($paged_arch_archdate_flag > 0)
  368. {
  369. $archivedate_start = mysql_real_escape_string($_GET['archivedate']) ."-01 00:00:00";
  370. $archivedate_end = mysql_real_escape_string($_GET['archivedate']) ."-31 23:59:59";
  371. $where = " AND datetime >='$archivedate_start' AND datetime <= '$archivedate_end' ";
  372. $monthname = mysql_real_escape_string($_GET['monthname']);
  373. $queryr = "SELECT count(*) AS count FROM ".$pixelpost_db_prefix."pixelpost WHERE datetime<='$datetime'" .$where;
  374. } // end if($_GET['archivedate'] != "")
  375. else // not cat selected return all images in the DB
  376. {
  377. $queryr = "SELECT count(*) AS count
  378. FROM {$pixelpost_db_prefix}pixelpost
  379. WHERE ( datetime<='$datetime')";
  380. } //end else
  381. $photonumb = mysql_query($queryr);
  382. $row = mysql_fetch_array($photonumb,MYSQL_ASSOC);
  383. // number of photos in the database in the same category
  384. $pixelpost_photonumb = $row['count'];
  385. // calculate the number of pages
  386. $num_browse_pages = (isset($_GET['pagenum'])) ? ceil($pixelpost_photonumb/$maxnumber_thumbs) : "";
  387. // initialize archive links
  388. $Archive_pages_Links = "";
  389. // selected category id
  390. if (isset($_GET['category'])){
  391. $cat_id = (int)$_GET['category'];
  392. } else {
  393. $cat_id = null;
  394. }
  395. //-------- Make page number to archive as links (for the selected category)
  396. // produce Previous page link
  397. if ($pagenum > 1)
  398. {
  399. $temp =$pagenum-1;
  400. if($cat_id != '') $Archive_pages_Links .= "<a href='index.php?x=browse&amp;category=$cat_id&amp;pagenum=$temp'>$lang_previous</a> ";
  401. else if($paged_arch_tag_flag > 0)
  402. {
  403. $Archive_pages_Links .= "<a href='index.php?x=browse&amp;tag=".mysql_real_escape_string($_GET['tag'])."&amp;pagenum=$temp'>$lang_previous</a> ";
  404. }
  405. else if($paged_arch_archdate_flag > 0)
  406. {
  407. $monthname=str_replace(" ","%20",$monthname);
  408. $archivedate=$_GET['archivedate'];
  409. $Archive_pages_Links .= "<a href='index.php?x=browse&amp;archivedate=$archivedate&amp;monthname=$monthname&amp;pagenum=$temp'>$lang_previous</a> ";
  410. }
  411. else $Archive_pages_Links .= "<a href='index.php?x=browse&amp;pagenum=$temp'>$lang_previous</a> ";
  412. }
  413. if($cat_id != '')
  414. {
  415. $pagecounter = 0;
  416. while ($pagecounter < $num_browse_pages)
  417. {
  418. $pagecounter++;
  419. if ($pagecounter != $pagenum){
  420. $Archive_pages_Links .= "<span class=\"archive_page_number\"><a href='index.php?x=browse&amp;category=$cat_id&amp;pagenum=$pagecounter'>$pagecounter</a></span> ";
  421. } else {
  422. $Archive_pages_Links .= "<span class=\"archive_active_page_number\"><a href='index.php?x=browse&amp;category=$cat_id&amp;pagenum=$pagecounter'>$pagecounter</a></span> ";
  423. }
  424. }// end while
  425. }// end if
  426. else if($paged_arch_tag_flag > 0)
  427. {
  428. $pagecounter = 0;
  429. while ($pagecounter < $num_browse_pages)
  430. {
  431. $pagecounter++;
  432. if ($pagecounter != $pagenum){
  433. $Archive_pages_Links .= "<span class=\"archive_page_number\"><a href='index.php?x=browse&amp;tag=".mysql_real_escape_string($_GET['tag'])."&amp;pagenum=$pagecounter'>$pagecounter</a></span> ";
  434. } else {
  435. $Archive_pages_Links .= "<span class=\"archive_active_page_number\"><a href='index.php?x=browse&amp;tag=".mysql_real_escape_string($_GET['tag'])."&amp;pagenum=$pagecounter'>$pagecounter</a></span> ";
  436. }
  437. }
  438. }
  439. else if($paged_arch_archdate_flag > 0)
  440. {
  441. $pagecounter = 0;
  442. while ($pagecounter < $num_browse_pages)
  443. {
  444. $monthname=str_replace(" ","%20",$monthname);
  445. $pagecounter++;
  446. $archivedate=mysql_real_escape_string($_GET['archivedate']);
  447. if ($pagecounter != $pagenum){
  448. $Archive_pages_Links .= "<span class=\"archive_page_number\"><a href='index.php?x=browse&amp;archivedate=$archivedate&amp;monthname=$monthname&amp;pagenum=$pagecounter'>$pagecounter</a></span> ";
  449. } else {
  450. $Archive_pages_Links .= "<span class=\"archive_active_page_number\"><a href='index.php?x=browse&amp;archivedate=$archivedate&amp;monthname=$monthname&amp;pagenum=$pagecounter'>$pagecounter</a></span> ";
  451. }
  452. }// whilte
  453. }// end if $_GET['archivedate']!=""
  454. else
  455. {
  456. $pagecounter = 0;
  457. while ($pagecounter < $num_browse_pages)
  458. {
  459. $pagecounter++;
  460. // added support for bold page number
  461. if ($pagecounter != $pagenum){
  462. $Archive_pages_Links .= "<span class=\"archive_page_number\"><a href='index.php?x=browse&amp;&amp;pagenum=$pagecounter'>$pagecounter</a></span> ";
  463. }else{
  464. $Archive_pages_Links .= "<span class=\"archive_active_page_number\"><a href='index.php?x=browse&amp;&amp;pagenum=$pagecounter'>$pagecounter</a></span> ";
  465. }
  466. }// end while
  467. }// end else
  468. // produce Next page link
  469. if ($pagenum < $num_browse_pages)
  470. {
  471. $temp = $pagenum+1;
  472. if($cat_id != '') $Archive_pages_Links .= "<a href='index.php?x=browse&amp;category=$cat_id&amp;pagenum=$temp'>$lang_next</a>";
  473. else if($paged_arch_tag_flag > 0)
  474. {
  475. $Archive_pages_Links .= "<a href='index.php?x=browse&amp;tag=".mysql_real_escape_string($_GET['tag'])."&amp;pagenum=$temp'>$lang_next</a>";
  476. }
  477. else if($paged_arch_archdate_flag > 0)
  478. {
  479. $monthname=str_replace(" ","%20",$monthname);
  480. $archivedate=mysql_real_escape_string($_GET['archivedate']);
  481. $Archive_pages_Links .= "<a href='index.php?x=browse&amp;archivedate=$archivedate&amp;monthname=$monthname&amp;pagenum=$temp'>$lang_next</a>";
  482. }
  483. else $Archive_pages_Links .= "<a href='index.php?x=browse&amp;pagenum=$temp'>$lang_next</a>";
  484. }
  485. // selected category name
  486. if($cat_id != "")
  487. {
  488. if ($language_abr == $default_language_abr)
  489. {
  490. $query = mysql_query("SELECT name FROM ".$pixelpost_db_prefix."categories WHERE id='$cat_id' ORDER BY name");
  491. $images_category_or_date = mysql_fetch_array($query,MYSQL_ASSOC);
  492. $images_category_or_date = pullout($images_category_or_date['name']);
  493. }
  494. else
  495. {
  496. $query = mysql_query("SELECT alt_name FROM ".$pixelpost_db_prefix."categories WHERE id='$cat_id' ORDER BY alt_name");
  497. $images_category_or_date = mysql_fetch_array($query,MYSQL_ASSOC);
  498. $images_category_or_date = pullout($images_category_or_date['alt_name']);
  499. }
  500. }
  501. else
  502. {
  503. if (isset($_GET['tag'])) $images_category_or_date = mysql_real_escape_string($_GET['tag']);
  504. else if (isset($_GET['archivedate'])) {
  505. $images_category_or_date = mysql_real_escape_string($_GET['monthname']);
  506. preg_match('/(\w+),\s/', $images_category_or_date, $naturalmonth);
  507. $natmonth = 'lang_'.strtolower($naturalmonth[1]);
  508. $mynatmonth = $$natmonth;
  509. $images_category_or_date=preg_replace('/\w+,(\s\d+)/', "$mynatmonth$1", $images_category_or_date);
  510. }
  511. else $images_category_or_date = $lang_browse_all;
  512. }
  513. } // end if ($_GET['x'] == "browse")
  514. //------------- Make Archive browse menu with link to paged archive
  515. // build browse menu
  516. $browse_select = "";
  517. $temppagenum =1;
  518. // do you use links with page number?
  519. if ($maxpthumb>0)
  520. {
  521. $browse_select = "<select name='browse' onchange='self.location.href=this.options[this.selectedIndex].value;'><option value=''>$lang_browse_select_category</option><option value='index.php?x=browse&amp;category=&amp;pagenum=$temppagenum'>$lang_browse_all (" .$pixelpost_all_photonumb .")</option>";
  522. }
  523. else
  524. {
  525. $browse_select = "<select name='browse' onchange='self.location.href=this.options[this.selectedIndex].value;'><option value=''>$lang_browse_select_category</option><option value='index.php?x=browse&amp;category='>$lang_browse_all (" .$pixelpost_all_photonumb .")</option>";
  526. }
  527. $query = mysql_query("SELECT * FROM ".$pixelpost_db_prefix."categories ORDER BY name");
  528. while(list($id,$name,$alt_name) = mysql_fetch_row($query))
  529. {
  530. if($language_abr == $default_language_abr) $name = pullout($name);
  531. else $name = pullout($alt_name);
  532. $queryr = "SELECT count(*) AS count,datetime
  533. FROM {$pixelpost_db_prefix}catassoc AS t1
  534. INNER JOIN {$pixelpost_db_prefix}pixelpost t2 on t2.id = t1.image_id
  535. WHERE (t1.cat_id = '".$id."' AND datetime<='$datetime')
  536. GROUP BY t1.cat_id ";
  537. $count = mysql_query($queryr);
  538. $count = mysql_fetch_array($count,MYSQL_ASSOC);
  539. $count= $count['count'];
  540. // check if you are using this addon
  541. // u r using
  542. if ($maxpthumb>0) $browse_select .= "<option value='index.php?x=browse&amp;category=$id&amp;pagenum=1'>$name (" .$count .")</option>";
  543. // use the original browse category menu
  544. else $browse_select .= "<option value='index.php?x=browse&amp;category=$id'>$name (" .$count .")</option>";
  545. } // end while
  546. // finilize the tag
  547. $browse_select .= "</select>";
  548. /* TAGS support */
  549. $tags_output = '<div id="tag_cloud">';
  550. $tags_output_reversed = $tags_output;
  551. $tags_paged_output = $tags_output;
  552. $tags_paged_output_reversed = $tags_output;
  553. $tags_output_no_num = $tags_output;
  554. $tags_output_reversed_no_num = $tags_output;
  555. $tags_paged_output_no_num = $tags_output;
  556. $tags_paged_output_reversed_no_num = $tags_output;
  557. $default_language_abr = strtolower($PP_supp_lang[$cfgrow['langfile']][0]);
  558. if($language_abr == $default_language_abr) $queryr = "SELECT COUNT(*) AS max
  559. FROM {$pixelpost_db_prefix}pixelpost AS p, {$pixelpost_db_prefix}tags AS t
  560. WHERE t.alt_tag LIKE '' AND p.id = t.img_id AND p.datetime<='$cdate'
  561. GROUP BY t.tag
  562. ORDER BY max DESC
  563. LIMIT 1";
  564. else $queryr = "SELECT COUNT(*) AS max
  565. FROM {$pixelpost_db_prefix}pixelpost AS p, {$pixelpost_db_prefix}tags AS t
  566. WHERE t.tag LIKE '' AND p.id = t.img_id AND p.datetime<='$cdate'
  567. GROUP BY alt_tag
  568. ORDER BY max DESC
  569. LIMIT 1";
  570. $tag_max = mysql_query($queryr);
  571. $tag_max = mysql_fetch_row($tag_max);
  572. $tag_max = $tag_max[0];
  573. if($tag_max == ''){ $tag_max = 0; }
  574. if ($language_abr == $default_language_abr) $queryr = "SELECT ROUND(COUNT(*)/$tag_max,1) AS rank, tag, COUNT(*) as cnt
  575. FROM {$pixelpost_db_prefix}pixelpost AS p, {$pixelpost_db_prefix}tags AS t
  576. WHERE t.alt_tag LIKE '' AND p.id = t.img_id AND p.datetime<='$cdate'
  577. GROUP BY tag
  578. ORDER BY tag";
  579. else $queryr = "SELECT ROUND(COUNT(*)/$tag_max,1) AS rank, alt_tag, COUNT(*) as cnt
  580. FROM {$pixelpost_db_prefix}pixelpost AS p, {$pixelpost_db_prefix}tags AS t
  581. WHERE t.tag LIKE '' AND p.id = t.img_id AND p.datetime<='$cdate'
  582. GROUP BY alt_tag
  583. ORDER BY alt_tag";
  584. $tags = mysql_query($queryr);
  585. while(list($rank, $tag, $cnt) = mysql_fetch_array($tags,MYSQL_NUM))
  586. {
  587. $tags_output .= '<a href="index.php?x=browse&amp;tag='.$tag.'" class="tags'.$rank[0].$rank[2].'">'.$tag.'&nbsp;('.$cnt.')</a> ';
  588. $tags_paged_output .= '<a href="index.php?x=browse&amp;tag='.$tag.'&amp;pagenum=1" class="tags'.$rank[0].$rank[2].'">'.$tag.'&nbsp;('.$cnt.')</a> ';
  589. $tags_output_no_num .= '<a href="index.php?x=browse&amp;tag='.$tag.'" class="tags'.$rank[0].$rank[2].'">'.$tag.'</a> ';
  590. $tags_paged_output_no_num .= '<a href="index.php?x=browse&amp;tag='.$tag.'&amp;pagenum=1" class="tags'.$rank[0].$rank[2].'">'.$tag.'</a> ';
  591. $rank_reversed = $rank;
  592. if ($rank[0]==1)
  593. {
  594. $rank_reversed[0]=0; //give the most important tag the lessest weight
  595. }
  596. else
  597. {
  598. $rank_reversed[2]=10-$rank[2];
  599. }
  600. $tags_output_reversed .= '<a href="index.php?x=browse&amp;tag='.$tag.'" class="tags'.$rank_reversed[0].$rank_reversed[2].'">'.$tag.'&nbsp;('.$cnt.')</a> ';
  601. $tags_paged_output_reversed .= '<a href="index.php?x=browse&amp;tag='.$tag.'&amp;pagenum=1" class="tags'.$rank_reversed[0].$rank_reversed[2].'">'.$tag.'&nbsp;('.$cnt.')</a> ';
  602. $tags_output_reversed_no_num .= '<a href="index.php?x=browse&amp;tag='.$tag.'" class="tags'.$rank_reversed[0].$rank_reversed[2].'">'.$tag.'</a> ';
  603. $tags_paged_output_reversed_no_num .= '<a href="index.php?x=browse&amp;tag='.$tag.'&amp;pagenum=1" class="tags'.$rank_reversed[0].$rank_reversed[2].'">'.$tag.'</a> ';
  604. }
  605. $tags_output .= '</div>';
  606. $tags_paged_output .= '</div>';
  607. $tags_output_reversed .= '</div>';
  608. $tags_paged_output_reversed .= '</div>';
  609. $tags_output_no_num .= '</div>';
  610. $tags_paged_output_no_num .= '</div>';
  611. $tags_output_reversed_no_num .= '</div>';
  612. $tags_paged_output_reversed_no_num .= '</div>';
  613. if ($language_abr == $default_language_abr) $queryr = "SELECT tag
  614. FROM {$pixelpost_db_prefix}tags
  615. WHERE img_id = " . $image_id . " AND tag != ''
  616. ORDER BY tag";
  617. else $queryr = "SELECT alt_tag
  618. FROM {$pixelpost_db_prefix}tags
  619. WHERE img_id = " . $image_id . " AND alt_tag != ''
  620. ORDER BY alt_tag";
  621. $tags = mysql_query($queryr);
  622. $tags_img = "";
  623. $tags_paged_img = "";
  624. $tags_keywords ="";
  625. if (@mysql_num_rows($tags)>0)
  626. {
  627. while(list($tag) = mysql_fetch_array($tags,MYSQL_BOTH))
  628. {
  629. $tags_img .= '<a href="index.php?x=browse&amp;tag='.$tag.'">'.$tag.'</a> ';
  630. $tags_paged_img .= '<a href="index.php?x=browse&amp;tag='.$tag.'&amp;pagenum=1">'.$tag.'</a> ';
  631. $tags_keywords .= $tag.', ';
  632. }
  633. }
  634. else
  635. {
  636. $tags_img =NULL;
  637. $tags_paged_img =NULL;
  638. $tags_keywords = NULL;
  639. }
  640. if($tags_img == '')
  641. {
  642. $tags_img = $lang_none;
  643. $tags_paged_img = $lang_none;
  644. }
  645. $tags_img = trim($tags_img);
  646. $tags_paged_img = trim($tags_paged_img);
  647. $tags_keywords = str_replace('_',' ',$tags_keywords);
  648. /***********************************************
  649. * BROWSE IMAGES MONTHLY
  650. ***********************************************/
  651. $query = "SELECT DISTINCT DATE_FORMAT( datetime, '%Y%m' )
  652. FROM ".$pixelpost_db_prefix."pixelpost
  653. WHERE datetime <= '$datetime' AND datetime > '0000-00-00 00:00:00'
  654. ORDER BY datetime ASC";
  655. $result = mysql_query($query);
  656. $start = mysql_fetch_row($result);
  657. $cym = $start[0];
  658. $y = substr($cym, 0, 4);
  659. $m = substr($cym, 4, 2);
  660. $cy = date('Y');
  661. $cm = date('m');
  662. $browse_monthly_menu = "<div id='br_mo_me'>\n";
  663. for($x = $y; $x <= $cy; $x++)
  664. {
  665. $browse_monthly_menu .= "<div class='br_mo_me_$x'>\n";
  666. for($m = 1; $m <= 12; $m++)
  667. {
  668. if($m == 1) $browse_monthly_menu .= "<span class='br_mo_me_y_$x'>$x</span>\n";
  669. $m = ($m < 10) ? "0$m" : $m;
  670. $m2 = ($x == $cy && $m == $cm) ? $m.' br_mo_me_curr' : $m;
  671. if($cym < "$x$m")
  672. {
  673. $cym = @mysql_fetch_array($result,MYSQL_NUM);
  674. $cym = $cym[0];
  675. }
  676. $browse_monthly_menu .= ($cym == "$x$m") ? " <a href='".PHP_SELF."?x=browse&amp;bryear=" . $x . "&amp;brmonth=" . $m . "' class='br_mo_me_" . $x . "_" . $m2 . "'>" . $m . "</a>\n" : " <span class='br_mo_me_" . $x . "_" . $m2 . "'>" . $m . "</span>\n";
  677. }
  678. $browse_monthly_menu .= "</div>\n";
  679. }
  680. $browse_monthly_menu .= "</div>\n";
  681. $tpl = str_replace("<BROWSE_MONTHLY_MENU>", $browse_monthly_menu, $tpl); //menu for browse images monthly
  682. /***********************************************
  683. * TEMPLATE TAGS REPLACEMNET
  684. ***********************************************/
  685. //tags for image tags
  686. $tpl = str_replace("<TAG_LINKS_AS_LIST>",$tags_output,$tpl); //thumbnails in this page
  687. $tpl = str_replace("<TAG_LINKS_AS_LIST_PAGED>",$tags_paged_output,$tpl); //thumbnails in this page
  688. $tpl = str_replace("<FOCUS_TAG_LINKS_AS_LIST>",$tags_output_reversed,$tpl); //thumbnails in this page
  689. $tpl = str_replace("<FOCUS_TAG_LINKS_AS_LIST_PAGED>",$tags_paged_output_reversed,$tpl); //thumbnails in this page
  690. $tpl = str_replace("<TAG_IMG_LIST>",$tags_img,$tpl); // list of tags for showed image
  691. $tpl = str_replace("<TAG_IMG_LIST_PAGED>",$tags_paged_img,$tpl); // list of tags for showed image
  692. $tpl = str_replace("<TAG_IMG_LIST_KEYWORDS>",$tags_keywords,$tpl); // list of tags for meta keywords
  693. //same tags as at the top but without image number
  694. $tpl = str_replace("<TAG_LINKS_AS_LIST_NO_NUM>",$tags_output_no_num,$tpl); //thumbnails in this page
  695. $tpl = str_replace("<TAG_LINKS_AS_LIST_PAGED_NO_NUM>",$tags_paged_output_no_num,$tpl); //thumbnails in this page
  696. $tpl = str_replace("<FOCUS_TAG_LINKS_AS_LIST_NO_NUM>",$tags_output_reversed_no_num,$tpl); //thumbnails in this page
  697. $tpl = str_replace("<FOCUS_TAG_LINKS_AS_LIST_PAGED_NO_NUM>",$tags_paged_output_reversed_no_num,$tpl); //thumbnails in this page
  698. //----------------- Build the additional new tages
  699. //-- If you use paged archive
  700. if (isset($pagenum))
  701. {
  702. $tpl = str_replace("<THUMBNAILS_WHOLE_PAGED>",$thumb_output,$tpl); //thumbnails in this page
  703. $tpl = str_replace("<THUMBNAILS_PAGES_LINKS>",$Archive_pages_Links,$tpl); // link to the pages of thumbnail in the selected category
  704. $tpl = str_replace("<ARCHIVE_PAGES_NUM>",$pagenum,$tpl);// page number you are viewing
  705. $tpl = str_replace("<CATEGORY_OR_DATE_NAME_PAGED_ARCHIVE>",$images_category_or_date,$tpl); // Name of the category or Month you select
  706. } //end if
  707. //-- If you do not use page archive
  708. else
  709. {
  710. $tpl = str_replace("<THUMBNAILS_PAGES_LINKS>","",$tpl); // this does not use paged archive so there should be no links
  711. $tpl = str_replace("<ARCHIVE_PAGES_NUM>","",$tpl); // page number you are viewing (it's empty for this case)
  712. if(!isset($thumb_output)) $thumb_output = "";
  713. $tpl = str_replace("<THUMBNAILS_WHOLE_PAGED>",$thumb_output,$tpl); // the original thumb row in the archive
  714. if(!isset($images_category_or_date)) $images_category_or_date = "";
  715. $tpl = str_replace("<CATEGORY_OR_DATE_NAME_PAGED_ARCHIVE>",$images_category_or_date,$tpl); // Name of the category or Month you select
  716. }// end else
  717. $tpl = str_replace("<LINK_TO_PAGED_ARCHIVE>",'<a href="index.php?x=browse&amp;pagenum=1">'.$lang_paged_archive.'</a>',$tpl);
  718. $tpl = str_replace("<BROWSE_CATEGORIES_PAGED>",$browse_select,$tpl); //Browse menu for paged archive
  719. // tags of Category List Of Links (default version)
  720. $tpl = str_replace("<CATEGORY_LINKS_AS_LIST>",$category_Link_List,$tpl);
  721. // paged version tages
  722. $tpl = str_replace("<CATEGORY_LINKS_AS_LIST_PAGED>",$category_Link_List_paged,$tpl);
  723. // bulid the new tag
  724. $tpl = str_replace("<BROWSE_MONTHLY_ARCHIVE_PAGED>",$archive_select,$tpl);
  725. $tpl = str_replace("<BROWSE_MONTHLY_ARCHIVE_AS_LINK_PAGED>",$archive_select_links,$tpl);
  726. ?>