FAP CUSTOMIZATION - Image Blocks In Page Header »  Show posts from    to     

Icy Phoenix


Archived phpBB Topics (Styles, Mods, Support) - FAP CUSTOMIZATION - Image Blocks In Page Header



krisbfunk [ Sun 14 Jan, 2007 09:09 ]
Post subject: FAP CUSTOMIZATION - Image Blocks In Page Header
Hey,

Got this code from Ricky on Smartor's site..

wondering how to convert it to FAP, I tried replacing album_page with album_showpage (in pageheader modification) and lang_main_album to lang_album_main and lang_admin_album to lang_album_admin in admin_header_album_block, but it still doesn't show a thumbnail.. any idea?

I'm looking to get a single random block and a single personal gallery block in my header.

install file:
Code: [Hide]
  1. ##############################################################  
  2. ## MOD Title: Photo Album Block Add-on  
  3. ## MOD Author: Kooky <kooky@altern.org> (n/a) http://perso.edeign.com/kooky/  
  4. ## MOD Description: This mod will show last or random pics on your portal (or index)  
  5. ## It uses album's permissions, approval options (and many more).  
  6. ## You can choose to add one or some pics and allow only one category  
  7. ## to be displayed on portal (no multi-cats support) with an Admin Panel.  
  8. ## MOD Version: 1.0.0  
  9. ## Compatibility: 2.0.3 - 2.0.10  
  10. ##  
  11. ## MOD Require: Photo Album Addon v2.0.53  
  12. ## Smartor <smartor_xp@hotmail.com> (Hoang Ngoc Tu) http://smartor.is-root.com  
  13. ##  
  14. ## Installation Level: Easy  
  15. ## Installation Time: 5 minutes  
  16. ## Files to Edit: 3  
  17. ## /includes/page_header.php  
  18. ## language/lang_english/lang_admin.php  
  19. ## templates/subSilver/overall_header.tpl  
  20. ## Included Files: 2  
  21. ## admin_header_album_block.php  
  22. ## album_header_block_body.tpl  
  23. ##  
  24. ##############################################################  
  25. ##############################################################  
  26. ## This MOD is released under the GPL License.  
  27. ## Intellectual Property is retained by the MOD Author(s) listed above  
  28. ##############################################################  
  29. ##############################################################  
  30. ## Author Notes:  
  31. ##  
  32. ## 1. Copyright and special thanks!  
  33. ## -----------  
  34. ## 2. Other than a few minor changes this is still Kooky's block,  
  35. ## all I did was make it work with the block for the portal so  
  36. ## both could be used at the same time. Later Ricky_Racer :)  
  37. ##  
  38. ##############################################################  
  39. ## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD  
  40. ##############################################################  
  41. #  
  42. #-----[ SQL ]------------------------------------------  
  43. #  
  44. INSERT INTO phpbb_album_config (config_name, config_value) VALUES ('header_cat_id', '0');  
  45. INSERT INTO phpbb_album_config (config_name, config_value) VALUES ('header_pics_all', '0');  
  46. INSERT INTO phpbb_album_config (config_name, config_value) VALUES ('header_pics_number', '1');  
  47. INSERT INTO phpbb_album_config (config_name, config_value) VALUES ('header_pics_sort', '0');  
  48. #  
  49. #-----[ COPY ]------------------------------------------  
  50. #  
  51. copy root/admin/admin_album_block.php to admin/admin_header_album_block.php  
  52. copy root/templates/admin/album_block_body.tpl to templates/admin/album_header_block_body.tpl  
  53. #  
  54. #-----[ OPEN ]------------------------------------------  
  55. #  
  56. /includes/page_header.php  
  57. #  
  58. #-----[ FIND ]------------------------------------------  
  59. #  
  60. // Format Timezone. We are unable to use array_pop here, because of PHP3 compatibility  
  61. $l_timezone = explode('.', $board_config['board_timezone']);  
  62. #  
  63. #-----[ BEFORE, ADD ]-----------------------------------  
  64. #  
  65. // Start add - Photo Album Block  
  66. $album_root_path = $phpbb_root_path . 'album_mod/';  
  67. include_once($album_root_path . 'album_common.'.$phpEx);  
  68. // Build Categories Index  
  69. $sql = "SELECT c.*  
  70. FROM ". ALBUM_CAT_TABLE ." AS c  
  71. LEFT JOIN ". ALBUM_TABLE ." AS p ON c.cat_id = p.pic_cat_id  
  72. WHERE cat_id <> 0  
  73. GROUP BY cat_id  
  74. ORDER BY cat_order ASC";  
  75. if ( !($result = $db->sql_query($sql)) )  
  76. {  
  77. message_die(GENERAL_ERROR, 'Could not query categories list', '', __LINE__, __FILE__, $sql);  
  78. }  
  79. $catrows = array();  
  80. while( $row = $db->sql_fetchrow($result) )  
  81. {  
  82. $album_user_access = album_user_access($row['cat_id'], $row, 1, 0, 0, 0, 0, 0); // VIEW  
  83. if ($album_user_access['view'] == 1)  
  84. {  
  85. $catrows[] = $row;  
  86. }  
  87. }  
  88. if ( $album_config['header_pics_all'] == '1' )  
  89. {  
  90. $allowed_cat = '0'; // For Recent Public Pics below  
  91. }  
  92. else  
  93. {  
  94. $allowed_cat = '';  
  95. }  
  96. // $catrows now stores all categories which this user can view. Dump them out!  
  97. for ($i = 0; $i < count($catrows); $i++)  
  98. {  
  99. // Build allowed category-list (for recent pics after here)  
  100. $allowed_cat .= ($allowed_cat == '') ? $catrows[$i]['cat_id'] : ',' . $catrows[$i]['cat_id'];  
  101. // Check Pic Approval  
  102. if ( ($catrows[$i]['cat_approval'] == ALBUM_ADMIN) || ($catrows[$i]['cat_approval'] == ALBUM_MOD) )  
  103. {  
  104. $pic_approval_sql = 'AND p.pic_approval = 1'; // Pic Approval ON  
  105. }  
  106. else  
  107. {  
  108. $pic_approval_sql = ''; // Pic Approval OFF  
  109. }  
  110. }  
  111. // Recent Public Pics  
  112. if ( $album_config['header_pics_all'] == '1' )  
  113. {  
  114. $pics_allowed = '0';  
  115. }  
  116. else  
  117. {  
  118. $pics_allowed = '';  
  119. }  
  120. if ( $allowed_cat != $pics_allowed )  
  121. {  
  122. $category_id = $album_config['header_cat_id'];  
  123. if ( $album_config['header_pics_sort'] == '1' )  
  124. {  
  125. if ( $category_id != 0 )  
  126. {  
  127. $sql = "SELECT p.pic_id, p.pic_title, p.pic_desc, p.pic_user_id, p.pic_user_ip, p.pic_username, p.pic_time, p.pic_cat_id, p.pic_view_count, u.user_id, u.username, u.user_level, r.rate_pic_id, AVG(r.rate_point) AS rating, COUNT(DISTINCT c.comment_id) AS comments, p.pic_filename AS picfilename  
  128. FROM ". ALBUM_TABLE ." AS p  
  129. LEFT JOIN ". USERS_TABLE ." AS u ON p.pic_user_id = u.user_id  
  130. LEFT JOIN ". ALBUM_CAT_TABLE ." AS ct ON p.pic_cat_id = ct.cat_id  
  131. LEFT JOIN ". ALBUM_RATE_TABLE ." AS r ON p.pic_id = r.rate_pic_id  
  132. LEFT JOIN ". ALBUM_COMMENT_TABLE ." AS c ON p.pic_id = c.comment_pic_id  
  133. WHERE p.pic_cat_id IN ($allowed_cat) AND ( p.pic_approval = 1 OR ct.cat_approval = 0 ) AND pic_cat_id = ($category_id)  
  134. GROUP BY p.pic_id  
  135. ORDER BY RAND()  
  136. LIMIT ". $album_config['header_pics_number'];  
  137. }  
  138. else  
  139. {  
  140. $sql = "SELECT p.pic_id, p.pic_title, p.pic_desc, p.pic_user_id, p.pic_user_ip, p.pic_username, p.pic_time, p.pic_cat_id, p.pic_view_count, u.user_id, u.username, u.user_level, r.rate_pic_id, AVG(r.rate_point) AS rating, COUNT(DISTINCT c.comment_id) AS comments, p.pic_filename AS picfilename  
  141. FROM ". ALBUM_TABLE ." AS p  
  142. LEFT JOIN ". USERS_TABLE ." AS u ON p.pic_user_id = u.user_id  
  143. LEFT JOIN ". ALBUM_CAT_TABLE ." AS ct ON p.pic_cat_id = ct.cat_id  
  144. LEFT JOIN ". ALBUM_RATE_TABLE ." AS r ON p.pic_id = r.rate_pic_id  
  145. LEFT JOIN ". ALBUM_COMMENT_TABLE ." AS c ON p.pic_id = c.comment_pic_id  
  146. WHERE p.pic_cat_id IN ($allowed_cat) AND ( p.pic_approval = 1 OR ct.cat_approval = 0 )  
  147. GROUP BY p.pic_id  
  148. ORDER BY RAND()  
  149. LIMIT ". $album_config['header_pics_number'];  
  150. }  
  151. }  
  152. else if ( $album_config['header_pics_sort'] == '0' )  
  153. {  
  154. if ( $category_id != 0 )  
  155. {  
  156. $sql = "SELECT p.pic_id, p.pic_title, p.pic_desc, p.pic_user_id, p.pic_user_ip, p.pic_username, p.pic_time, p.pic_cat_id, p.pic_view_count, u.user_id, u.username, u.user_level, r.rate_pic_id, AVG(r.rate_point) AS rating, COUNT(DISTINCT c.comment_id) AS comments, p.pic_filename AS picfilename  
  157. FROM ". ALBUM_TABLE ." AS p  
  158. LEFT JOIN ". USERS_TABLE ." AS u ON p.pic_user_id = u.user_id  
  159. LEFT JOIN ". ALBUM_CAT_TABLE ." AS ct ON p.pic_cat_id = ct.cat_id  
  160. LEFT JOIN ". ALBUM_RATE_TABLE ." AS r ON p.pic_id = r.rate_pic_id  
  161. LEFT JOIN ". ALBUM_COMMENT_TABLE ." AS c ON p.pic_id = c.comment_pic_id  
  162. WHERE p.pic_cat_id IN ($allowed_cat) AND ( p.pic_approval = 1 OR ct.cat_approval = 0 ) AND pic_cat_id = ($category_id)  
  163. GROUP BY p.pic_id  
  164. ORDER BY pic_time DESC  
  165. LIMIT ". $album_config['header_pics_number'];  
  166. }  
  167. else  
  168. {  
  169. $sql = "SELECT u.user_level, p.pic_id, p.pic_title, p.pic_desc, p.pic_user_id, p.pic_user_ip, p.pic_username, p.pic_time, p.pic_cat_id, p.pic_view_count, u.user_id, u.username, u.user_level, r.rate_pic_id, AVG(r.rate_point) AS rating, COUNT(DISTINCT c.comment_id) AS comments, p.pic_filename AS picfilename  
  170. FROM ". ALBUM_TABLE ." AS p  
  171. LEFT JOIN ". USERS_TABLE ." AS u ON p.pic_user_id = u.user_id  
  172. LEFT JOIN ". ALBUM_CAT_TABLE ." AS ct ON p.pic_cat_id = ct.cat_id  
  173. LEFT JOIN ". ALBUM_RATE_TABLE ." AS r ON p.pic_id = r.rate_pic_id  
  174. LEFT JOIN ". ALBUM_COMMENT_TABLE ." AS c ON p.pic_id = c.comment_pic_id  
  175. WHERE p.pic_cat_id IN ($allowed_cat) AND ( p.pic_approval = 1 OR ct.cat_approval = 0 )  
  176. GROUP BY p.pic_id  
  177. ORDER BY pic_time DESC  
  178. LIMIT ". $album_config['header_pics_number'];  
  179. }  
  180. }  
  181. if ( !($result = $db->sql_query($sql)) )  
  182. {  
  183. message_die(GENERAL_ERROR, 'Could not query recent pics information', '', __LINE__, __FILE__, $sql);  
  184. }  
  185. $recentrow = array();  
  186. while( $row = $db->sql_fetchrow($result) )  
  187. {  
  188. $recentrow[] = $row;  
  189. }  
  190. if (count($recentrow) > 0)  
  191. {  
  192. for ($i = 0; $i < count($recentrow); $i += $album_config['cols_per_page'])  
  193. {  
  194. $template->assign_block_vars('recent_header_pics', array());  
  195. for ($j = $i; $j < ($i + $album_config['cols_per_page']); $j++)  
  196. {  
  197. if ( $j >= count($recentrow) )  
  198. {  
  199. break;  
  200. }  
  201. if (!$recentrow[$j]['rating'])  
  202. {  
  203. $recentrow[$j]['rating'] = $lang['Not_rated'];  
  204. }  
  205. else  
  206. {  
  207. $recentrow[$j]['rating'] = round($recentrow[$j]['rating'], 2);  
  208. }  
  209. // Display pics horizontally  
  210. $template->assign_block_vars('recent_header_pics.recent_col', array(  
  211. 'U_PIC' => ($album_config['fullpic_popup']) ? append_sid("album_pic.$phpEx?pic_id=". $recentrow[$j]['pic_id']) : append_sid("album_page.$phpEx?pic_id=". $recentrow[$j]['pic_id']),  
  212. 'THUMBNAIL' => append_sid("album_thumbnail.$phpEx?pic_id=". $recentrow[$j]['pic_id']),  
  213. 'DESC' => $recentrow[$j]['pic_desc'])  
  214. );  
  215. if ( ($recentrow[$j]['user_id'] == ALBUM_GUEST) or ($recentrow[$j]['username'] == '') )  
  216. {  
  217. $recent_poster = ($recentrow[$j]['pic_username'] == '') ? $lang['Guest'] : $recentrow[$j]['pic_username'];  
  218. }  
  219. else  
  220. {  
  221. // Start add - Username Color Mod  
  222. switch ( $recentrow[$j]['user_level'] )  
  223. {  
  224. case ADMIN:  
  225. $poster_name = '<b>' . $recentrow[$j]['username'] . '</b>';  
  226. $style_color = ' style="color:#' . $theme['fontcolor3'] . '"';  
  227. break;  
  228. case MOD:  
  229. $poster_name = '<b>' . $recentrow[$j]['username'] . '</b>';  
  230. $style_color = ' style="color:#' . $theme['fontcolor2'] . '"';  
  231. break;  
  232. default:  
  233. $poster_name = $recentrow[$j]['username'];  
  234. $style_color = '';  
  235. break;  
  236. }  
  237. // End add - Username Color Mod  
  238. $recent_poster = '<a href="' . append_sid("profile.$phpEx?mode=viewprofile&amp;". POST_USERS_URL .'='. $recentrow[$j]['user_id']) . '"' . $style_color . '>' . $poster_name . '</a>';  
  239. }  
  240. // Start add - Pics Dimension/Size Add-on  
  241. $pic_dimension = getimagesize(ALBUM_UPLOAD_PATH . $recentrow[$j]['picfilename']);  
  242. $pic_width = $pic_dimension[0];  
  243. $pic_height = $pic_dimension[1];  
  244. $pic_size = round(((filesize(ALBUM_UPLOAD_PATH . $recentrow[$j]['picfilename'])) / 1024), 2) . ' ' . $lang['Kb'];  
  245. // End add - Pics Dimension/Size Add-on  
  246. // Display pics vertically  
  247. $template->assign_block_vars('recent_header_pics.recent_detail', array(  
  248. 'U_PIC' => ($album_config['fullpic_popup']) ? append_sid("album_pic.$phpEx?pic_id=". $recentrow[$j]['pic_id']) : append_sid("album_page.$phpEx?pic_id=". $recentrow[$j]['pic_id']),  
  249. 'THUMBNAIL' => append_sid("album_thumbnail.$phpEx?pic_id=". $recentrow[$j]['pic_id']),  
  250. 'DESC' => $recentrow[$j]['pic_desc'],  
  251. 'TITLE' => $recentrow[$j]['pic_title'],  
  252. 'POSTER' => $recent_poster,  
  253. 'TIME' => create_date($board_config['default_dateformat'], $recentrow[$j]['pic_time'], $board_config['board_timezone']),  
  254. // New entries - Pics Dimension/Size Add-on  
  255. 'DIMENSION' => $pic_width . ' x ' . $pic_height,  
  256. 'SIZE' => $pic_size,  
  257. 'VIEW' => $recentrow[$j]['pic_view_count'],  
  258. 'RATING' => ($album_config['rate'] == 1) ? ( $lang['Rating'] . ': <a href="' . append_sid("album_rate.$phpEx?pic_id=". $recentrow[$j]['pic_id']) . '">' . $recentrow[$j]['rating'] . '</a><br />') : '',  
  259. 'COMMENTS' => ($album_config['comment'] == 1) ? ( $lang['Comments'] . ': <a href="' . append_sid("album_comment.$phpEx?pic_id=". $recentrow[$j]['pic_id']) . '">' . $recentrow[$j]['comments'] . '</a>') : '')  
  260. );  
  261. }  
  262. }  
  263. }  
  264. else  
  265. {  
  266. // No Pics Found  
  267. $template->assign_block_vars('no_header_pics', array());  
  268. }  
  269. }  
  270. else  
  271. {  
  272. // No Cats Found  
  273. $template->assign_block_vars('no_header_pics', array());  
  274. }  
  275. // End add - Photo Album Block  
  276. #  
  277. #-----[ FIND ]------------------------------------------  
  278. #  
  279. 'NAV_LINKS' => $nav_links_html)  
  280. );  
  281. #  
  282. #-----[ BEFORE, ADD ]-----------------------------------  
  283. #  
  284. // Start add - Photo Album Block  
  285. 'S_COLS' => $album_config['cols_per_page'],  
  286. 'S_COL_WIDTH' => ( 100/$album_config['cols_per_page'] ) . '%',  
  287. 'TARGET_BLANK' => ( $album_config['fullpic_popup'] ) ? ' target="_blank"' : '',  
  288. 'U_ALBUM' => append_sid('album.'.$phpEx),  
  289. 'L_ALBUM' => $lang['Album'],  
  290. 'L_NEWEST_PICS' => ( $album_config['pics_sort'] == '0' ) ? $lang['Newest_pics'] : $lang['Random_pics'],  
  291. 'L_NO_PICS' => $lang['No_Pics'],  
  292. 'L_PIC_TITLE' => $lang['Pic_Title'],  
  293. 'L_POSTER' => $lang['Poster'],  
  294. 'L_POSTED' => $lang['Posted'],  
  295. 'L_DIMENSION' => $lang['Dimension'],  
  296. 'L_SIZE' => $lang['Size'],  
  297. 'L_VIEW' => $lang['View'],  
  298. // End add - Photo Album Block  
  299. #  
  300. #-----[ OPEN ]------------------------------------------  
  301. #  
  302. language/lang_english/lang_admin.php  
  303.  
  304. #  
  305. #-----[ FIND ]------------------------------------------  
  306. #  
  307. ?>  
  308. #  
  309. #-----[ BEFORE, ADD ]-----------------------------------  
  310. #  
  311. // Start add - Photo Album Block Header  
  312. $lang['header_photo_block'] = 'Header Photo Album Block';  
  313. $lang['header_album_block_config'] = 'Header Photo Album Block Configuration';  
  314. $lang['header_album_block_config_explain'] = 'Here, you can change the general settings of your Header Photo Album Block.';  
  315. $lang['Click_return_header_album_block_config'] = 'Click %sHere%s to return to the Header Photo Album Block Configuration';  
  316. $lang['Pics_header_cat_id'] = 'Pics category';  
  317. $lang['Pics_header_cat_id_explain'] = 'ID from a category of the Photo Album.<br />Multi-categories are not supported, 0 means all categories were used.';  
  318. $lang['Pics_header_number'] = 'Number of pics';  
  319. $lang['Pics_header_number_explain'] = 'Show the number of pics you want to view in the header.';  
  320. $lang['Pics_header_all'] = 'Enable personal gallery viewing';  
  321. $lang['Pics_header_sort'] = 'Show randomly your pics';  
  322. // End add - Photo Album Block Header  
  323. #  
  324. #-----[ OPEN ]------------------------------------------  
  325. #  
  326. templates/subSilver/overall_header.tpl  
  327. #  
  328. #-----[ FIND ]------------------------------------------  
  329. #  
  330. </tr>  
  331. </table></td>  
  332. </tr>  
  333. </table>  
  334. <br />  
  335. #  
  336. #-----[ AFTER, ADD ]------------------------------------  
  337. #  
  338. <table width="99%" cellpadding="2" cellspacing="1" border="0" align="center" class="forumline">  
  339. <tr>  
  340. <th class="thTop" height="25" colspan="{S_COLS}" nowrap="nowrap">{L_NEWEST_PICS}</th>  
  341. </tr>  
  342. <!-- BEGIN no_header_pics -->  
  343. <tr>  
  344. <td class="row1" align="center" colspan="{S_COLS}" height="50"><span class="gen">{L_NO_PICS}</span></td>  
  345. </tr>  
  346. <!-- END no_header_pics -->  
  347. <!-- BEGIN recent_header_pics -->  
  348. <tr>  
  349. <!-- BEGIN recent_col -->  
  350. <td class="row1" width="{S_COL_WIDTH}" align="center"><a href="{recent_header_pics.recent_col.U_PIC}"{TARGET_BLANK}><img src="{recent_header_pics.recent_col.THUMBNAIL}" border="0" alt="{recent_header_pics.recent_col.DESC}" title="{recent_header_pics.recent_col.DESC}" vspace="10" /></a></td>  
  351. <!-- END recent_col -->  
  352. </tr>  
  353. <tr>  
  354. <!-- BEGIN recent_detail -->  
  355. <td class="row2" align="center"><span class="gensmall">  
  356. {L_PIC_TITLE}: {recent_header_pics.recent_detail.TITLE}<br />  
  357. {L_POSTER}: {recent_header_pics.recent_detail.POSTER}<br />  
  358. {L_POSTED}: {recent_header_pics.recent_detail.TIME}<br />  
  359. {L_DIMENSION}: {recent_header_pics.recent_detail.DIMENSION}<br />  
  360. {L_SIZE}: {recent_header_pics.recent_detail.SIZE}<br />  
  361. {L_VIEW}: {recent_header_pics.recent_detail.VIEW}<br />  
  362. {recent_header_pics.recent_detail.RATING}{recent_header_pics.recent_detail.COMMENTS}<br />  
  363. </span>  
  364. </td>  
  365. <!-- END recent_detail -->  
  366. </tr>  
  367. <!-- END recent_header_pics -->  
  368. <tr>  
  369. <td class="row3" height="25" align="center" colspan="{S_COLS}"><span class="gensmall">[ <a href="{U_ALBUM}">{L_ALBUM}</a> ]</span></td>  
  370. </tr>  
  371. </table>  
  372. <br />  
  373. #  
  374. #-----[ SAVE/CLOSE ALL FILES ]------------------------------------------  
  375. #  
  376. # END 


admin_header_album_block.php
Code: [Hide]
  1. <?php  
  2. /***************************************************************************  
  3. * admin_header_album_block.php  
  4. * -------------------  
  5. * begin : Monday, August 14, 2004  
  6. * copyright : (C) 2004 Kooky  
  7. * email : kooky@altern.org  
  8. *  
  9. * $Id: admin_header_album_block.php,v 1.0.0 2004/08/14, 02:11:14 kooky Exp $  
  10. *  
  11. * This program is free software; you can redistribute it and/or modify  
  12. * it under the terms of the GNU General Public License as published by  
  13. * the Free Software Foundation; either version 2 of the License, or  
  14. * (at your option) any later version.  
  15. *  
  16. ***************************************************************************/  
  17. define('IN_PHPBB', true);  
  18. if( !empty($setmodules) )  
  19. {  
  20. $filename = basename(__FILE__);  
  21. $module['Photo_Album']['Header_Photo_Block'] = $filename;  
  22. return;  
  23. }  
  24. // Let's set the root dir for phpBB  
  25. $phpbb_root_path = '../';  
  26. require($phpbb_root_path . 'extension.inc');  
  27. require('./pagestart.' . $phpEx);  
  28. require($phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_main_album.' . $phpEx);  
  29. require($phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_admin_album.' . $phpEx);  
  30. // Pull all config data  
  31. $sql = "SELECT * FROM " . ALBUM_CONFIG_TABLE;  
  32. if(!$result = $db->sql_query($sql))  
  33. {  
  34. message_die(CRITICAL_ERROR, "Could not query Album config information", "", __LINE__, __FILE__, $sql);  
  35. }  
  36. else  
  37. {  
  38. while( $row = $db->sql_fetchrow($result) )  
  39. {  
  40. $config_name = $row['config_name'];  
  41. $config_value = $row['config_value'];  
  42. $default_config[$config_name] = $config_value;  
  43. $new[$config_name] = ( isset($HTTP_POST_VARS[$config_name]) ) ? $HTTP_POST_VARS[$config_name] : $default_config[$config_name];  
  44. if( isset($HTTP_POST_VARS['submit']) )  
  45. {  
  46. $sql = "UPDATE " . ALBUM_CONFIG_TABLE . " SET  
  47. config_value = '" . str_replace("'", "''", $new[$config_name]) . "'  
  48. WHERE config_name = '$config_name'";  
  49. if( !$db->sql_query($sql) )  
  50. {  
  51. message_die(GENERAL_ERROR, "Failed to update Album configuration for $config_name", "", __LINE__, __FILE__, $sql);  
  52. }  
  53. }  
  54. }  
  55. if( isset($HTTP_POST_VARS['submit']) )  
  56. {  
  57. $message = $lang['Album_config_updated'];  
  58. $message .= '<br /><br />' . sprintf($lang['Click_return_header_album_block_config'], '<a href="' . append_sid("admin_header_album_block.$phpEx") . '">', '</a>');  
  59. $message .= '<br /><br />' . sprintf($lang['Click_return_album_config'], '<a href="' . append_sid("admin_album_config.$phpEx") . '">', '</a>') . '<br /><br />' . sprintf($lang['Click_return_admin_index'], '<a href="' . append_sid("index.$phpEx?pane=right") . '">', '</a>');  
  60. message_die(GENERAL_MESSAGE, $message);  
  61. }  
  62. }  
  63. // Allow all pics  
  64. $header_pics_all_yes = ( $new['header_pics_all'] ) ? ' checked="checked"' : '';  
  65. $header_pics_all_no = ( !$new['header_pics_all'] ) ? ' checked="checked"' : '';  
  66. // Sort pics  
  67. $header_pics_sort_yes = ( $new['header_pics_sort'] ) ? ' checked="checked"' : '';  
  68. $header_pics_sort_no = ( !$new['header_pics_sort'] ) ? ' checked="checked"' : '';  
  69. $template->set_filenames(array(  
  70. "body" => "admin/album_header_block_body.tpl")  
  71. );  
  72. $template->assign_vars(array(  
  73. 'L_ALBUM_HEADER_BLOCK_CONFIG' => $lang['header_album_block_config'],  
  74. 'L_ALBUM_HEADER_BLOCK_CONFIG_EXPLAIN' => $lang['header_album_block_config_explain'],  
  75. 'S_ALBUM_HEADER_BLOCK_CONFIG_ACTION' => append_sid('admin_header_album_block.'.$phpEx),  
  76. 'HEADER_PICS_CAT_ID' => $new['header_cat_id'],  
  77. 'HEADER_PICS_NUMBER' => $new['header_pics_number'],  
  78. 'HEADER_PICS_ALL_YES' => $header_pics_all_yes,  
  79. 'HEADER_PICS_ALL_NO' => $header_pics_all_no,  
  80. 'HEADER_PICS_SORT_YES' => $header_pics_sort_yes,  
  81. 'HEADER_PICS_SORT_NO' => $header_pics_sort_no,  
  82. 'L_PICS_HEADER_CAT_ID' => $lang['Pics_header_cat_id'],  
  83. 'L_PICS_HEADER_CAT_ID_EXPLAIN' => $lang['Pics_header_cat_id_explain'],  
  84. 'L_HEADER_PICS_NUMBER' => $lang['Pics_header_number'],  
  85. 'L_HEADER_PICS_NUMBER_EXPLAIN' => $lang['Pics_header_number_explain'],  
  86. 'L_HEADER_PICS_ALL' => $lang['Pics_header_all'],  
  87. 'L_HEADER_PICS_SORT' => $lang['Pics_header_sort'],  
  88. 'L_DISABLED' => $lang['Disabled'],  
  89. 'L_ENABLED' => $lang['Enabled'],  
  90. 'L_YES' => $lang['Yes'],  
  91. 'L_NO' => $lang['No'],  
  92. 'L_SUBMIT' => $lang['Submit'],  
  93. 'L_RESET' => $lang['Reset'])  
  94. );  
  95. $template->pparse("body");  
  96. include('./page_footer_admin.'.$phpEx);  
  97. ?> 



admin_header_block_body.tpl
Code: [Hide]
  1. <h1>{L_ALBUM_HEADER_BLOCK_CONFIG}</h1>  
  2. <p>{L_ALBUM_HEADER_BLOCK_CONFIG_EXPLAIN}</p>  
  3. <form action="{S_ALBUM_HEADER_BLOCK_CONFIG_ACTION}" method="post">  
  4. <table width="100%" cellpadding="4" cellspacing="1" border="0" class="forumline">  
  5. <tr>  
  6. <th class="thHead" colspan="2">{L_ALBUM_HEADER_BLOCK_CONFIG}</th>  
  7. </tr>  
  8. <td class="row1" width="40%">  
  9. <span class="genmed">{L_PICS_HEADER_CAT_ID}</span><br />  
  10. <span class="gensmall">{L_PICS_HEADER_CAT_ID_EXPLAIN}</span><br />  
  11. </td>  
  12. <td class="row2" width="60%"><input type="text" class="post" name="header_cat_id" maxlength="2" size="5" value="{HEADER_PICS_CAT_ID}" /></td>  
  13. </tr>  
  14. <tr>  
  15. <td class="row1" width="40%">  
  16. <span class="genmed">{L_HEADER_PICS_NUMBER}<br />  
  17. <span class="gensmall">{L_HEADER_PICS_NUMBER_EXPLAIN}</span><br />  
  18. </td>  
  19. <td class="row2" width="60%"><input type="text" class="post" name="header_pics_number" maxlength="2" size="5" value="{HEADER_PICS_NUMBER}" /></td>  
  20. </tr>  
  21. <tr>  
  22. <td class="row1" width="40%"><span class="genmed">{L_HEADER_PICS_ALL}</span></td>  
  23. <td class="row2">  
  24. <input type="radio" name="header_pics_all" value="1"{HEADER_PICS_ALL_YES} />  
  25. <span class="genmed">{L_YES}</span>&nbsp;&nbsp;  
  26. <input type="radio" name="header_pics_all" value="0"{HEADER_PICS_ALL_NO} />  
  27. <span class="genmed">{L_NO}</span>  
  28. </td>  
  29. </tr>  
  30. <tr>  
  31. <td class="row1" width="40%"><span class="genmed">{L_HEADER_PICS_SORT}</span></td>  
  32. <td class="row2">  
  33. <input type="radio" name="header_pics_sort" value="1"{HEADER_PICS_SORT_YES} />  
  34. <span class="genmed">{L_YES}</span>&nbsp;&nbsp;  
  35. <input type="radio" name="header_pics_sort" value="0"{HEADER_PICS_SORT_NO} />  
  36. <span class="genmed">{L_NO}</span>  
  37. </td>  
  38. </tr>  
  39. <tr>  
  40. <td class="catBottom" colspan="2" align="center">{S_HIDDEN_FIELDS}  
  41. <input type="submit" name="submit" value="{L_SUBMIT}" class="mainoption" />  
  42. &nbsp;&nbsp;  
  43. <input type="reset" value="{L_RESET}" class="liteoption" />  
  44. </td>  
  45. </tr>  
  46. </table>  
  47. </form>  
  48. <br /> 


jz [ Sun 14 Jan, 2007 11:02 ]
Post subject: Re: Image Blocks In Header
krisbfunk,

FAP already has this option built in, what kind of board are you using? If you ae using XS / Icy then all you have to do is enable the option from yor ACP :mrorange:


krisbfunk [ Mon 15 Jan, 2007 00:20 ]
Post subject: Re: Image Blocks In Header
phpbb 2.0.21

it has the ability to put personal gallery / random blocks configurable in the ACP for the header?


jz [ Mon 15 Jan, 2007 02:30 ]
Post subject: Re: Image Blocks In Header
have you got a linl to your site?

If you're using phpbbXS or ICY then what you want is done from the ACP.


krisbfunk [ Tue 16 Jan, 2007 17:49 ]
Post subject: Re: Image Blocks In Header
i have a link to my test forum, PM'd you it




Powered by Icy Phoenix