- Code: Select all
################################################################# ## Mod Title]http://www.wyvern.com.au/~sam/mods#[/url]# Description: This mod allows you to display an image next to ## each of your categories. This is useful for ## corporate websites where companies may pay to ## display their logo next to a catagory as the ## 'sponser'.## ## Installation Level: Moderate## Installation Time: 10-15 Minutes ## Files To Edit: x ## Included Files: INSTALL ################################################################# ## ## Author Notes: ## ~~~~~~~~~~~~ ## o If you use EasyMod you will still have to run the SQL below ## manually. At the moment it comes in only MYSQL flavour. If ## anyone else can give me a hand, I'd love to have some ## translastions ;) ## ## o This was created for [url=http://www.hosting-chat.co.uk/]http://www.hosting-chat.co.uk/[/url] ## ## o This mod is EasyMod v0.4alpha compatible. ## [url=http://www.phpbb.com/community/viewtopic?t=12345]http://www.phpbb.com/community/viewtopic?t=12345[/url] ## ## o Questions? Comments? LET ME KNOW! I would love to hear how ## and where you use this script and how useful it is to you. ## Feel free to submit bugs, feature requests and sugestions ## to my email or private message me at [url=http://www.phpbb.com/]http://www.phpbb.com/[/url] ## ## Change Log: ## ~~~~~~~~~~ ## 1.0.0 ## o Initial release ## o EasyMod v0.4alpha compatible ## ################################################################# # #-----[ RUN SQL ]------------------------------------------------ # # You may have to change your database prefix # MYSQL: ALTER TABLE phpbb_categories ADD cat_sponser_img VARCHAR(255) NOT NULL, ADD cat_sponser_url VARCHAR(255) NOT NULL;# #-----[ OPEN ]--------------------------------------------------- # index.php# #-----[ FIND ]--------------------------------------------------- # $sql = "SELECT c.# #-----[ REPLACE ]------------------------------------------------ # $sql = "SELECT c.*# #-----[ FIND ]--------------------------------------------------- # $template->assign_block_vars('catrow', array( 'CAT_ID' => $cat_id,# #-----[ AFTER, ADD ]--------------------------------------------- # 'SPONSER' => ( $category_rows[$i]['cat_sponser_img'] ? ( $category_rows[$i]['cat_sponser_url'] ? '<a>' : '' ) . '<img>' : '' ), # #-----[ OPEN ]--------------------------------------------------- # templates/subSilver/index_body.tpl# #-----[ FIND ]--------------------------------------------------- # <td> </td># #-----[ IN-LINE FIND ]------------------------------------------- # </td># #-----[ IN-LINE BEFORE, ADD ]------------------------------------ # {catrow.SPONSER}# #-----[ OPEN ]--------------------------------------------------- # admin/admin_forums.php# #-----[ FIND ]--------------------------------------------------- # $template->assign_vars(array( 'CAT_TITLE' => $cat_title,# #-----[ AFTER, ADD ]--------------------------------------------- # 'CAT_SPONSER_IMG' => $row['cat_sponser_img'], 'CAT_SPONSER_URL' => $row['cat_sponser_url'], 'L_CAT_SPONSER_IMAGE' => $lang['Category_sponser_image'], 'L_CAT_SPONSER_URL' => $lang['Category_sponser_url'],# # Full lines:# $sql = "UPDATE " . CATEGORIES_TABLE . "# SET cat_title = '" . str_replace("'", "''", $HTTP_POST_VARS['cat_title']) . "'# WHERE cat_id = " . intval($HTTP_POST_VARS[POST_CAT_URL]);##-----[ FIND ]--------------------------------------------------- # $sql = "UPDATE " . CATEGORIES_TABLE . " SET WHERE # #-----[ IN-LINE FIND ]------------------------------------------- # cat_title']) . "'# #-----[ IN-LINE AFTER, ADD ]------------------------------------- # , cat_sponser_img = '" . str_replace("'", "''", $HTTP_POST_VARS['cat_sponser_img']) . "', cat_sponser_url = '" . str_replace("'", "''", $HTTP_POST_VARS['cat_sponser_url']) . "' # #-----[ OPEN ]--------------------------------------------------- # language/lang_english/lang_admin.php# #-----[ FIND ]--------------------------------------------------- # //// That's all Folks!// -------------------------------------------------# #-----[ BEFORE, ADD ]-------------------------------------------- # $lang['Category_sponser_image'] = "Category Sponser Image";$lang['Category_sponser_url'] = "Category Sponser URL"; # #-----[ OPEN ]--------------------------------------------------- # templates/subSilver/admin/category_edit_body.tpl# #-----[ FIND ]--------------------------------------------------- # <tr> <td>{L_CATEGORY} <td> </tr># #-----[ AFTER, ADD ]--------------------------------------------- # <tr> <td>{L_CAT_SPONSER_IMAGE}</td> <td><input></td> </tr> <tr> <td>{L_CAT_SPONSER_URL}</td> <td><input></td> </tr># #-----[ SAVE/CLOSE ALL FILES ]----------------------------------- # #EoM