Forum Sponsors

All new MODs released in our MOD Database will be announced in here. All support for released MODs needs to take place in here. No new MODs will be accepted into the MOD Database for phpBB2
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

On February 1, 2009 this forum will be set to read only as part of retiring of phpBB2.

Rating:

Excellent!
11
50%
Very Good
5
23%
Good
3
14%
Fair
2
9%
Poor
1
5%
 
Total votes: 22

User avatar
KMac
Registered User
Posts: 49
Joined: Wed Oct 25, 2006 12:22 am

Post by KMac »

Excellent mod...thanks! Works like a champ!

Ran into some troubles with the Simple Subforums mod installed, so here is the mod edited if you have the Simple Subforums mod installed.


Note: Use this ONLY if you have the simple subforums mod installed!!!

Code: Select all

##############################################################
## MOD Title: Forum Sponsors
## MOD Author: EXreaction < exreaction@lithiumstudios.org > (Nathan Guse) http://www.lithiumstudios.org
## MOD Description: Allows you to add advertisments in specific forums
## MOD Version: 1.0.01
##
## Installation Level: Intermediate
## Installation Time: ~5 Minutes
## Files To Edit:	admin/admin_forums.php
##					includes/page_header.php
##					language/lang_english/lang_main.php
##					templates/subSilver/viewforum_body.tpl
##					templates/subSilver/viewtopic_body.tpl
##					templates/subSilver/admin/forum_edit_body.tpl
## Included Files:	none
## License: http://opensource.org/licenses/gpl-license.php GNU General Public License v2
##############################################################
## For security purposes, please check: http://www.phpbb.com/mods/
## for the latest version of this MOD. Although MODs are checked
## before being allowed in the MODs Database there is no guarantee
## that there are no security problems within the MOD. No support
## will be given for MODs not found within the MODs Database which
## can be found at http://www.phpbb.com/mods/
##############################################################
## Author Notes:
## This mod is owned by WW < bjgobble@yahoo.com > http://www.thearkansashuntingandfishingforum.com,
##  and was created by EXreaction.
##
## Please use my forums(you can find them at http://www.lithiumstudios.org)
##  for support.  WW paid for this mod and was kind enough to allow me to release this mod to everyone, so
##  drop him a thanks over at his forum(located at http://www.thearkansashuntingandfishingforum.com).
##
## If you want to move the location of the ad placement in viewforum and viewtopic, simply change the locations
##  of the sections that were added to viewforum_body.tpl and viewtopic_body.tpl.
##############################################################
## MOD History:
## 
##   2006-07-31 - Version 1.0.0
##      - Initial Release
##   2006-08-20 - Version 1.0.01
##      - Fixes
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################

#
#-----[ SQL ]-------------------------------------------
#

ALTER TABLE `phpbb_forums` ADD `sponsor` TEXT NOT NULL;

# 
#-----[ OPEN ]------------------------------------------
# 

admin/admin_forums.php

#
#-----[ FIND ]------------------------------------------
# 

			$s_hidden_fields = '<input type="hidden" name="mode" value="' . $newmode .'" /><input type="hidden" name="' . POST_FORUM_URL . '" value="' . $forum_id . '" />';

			$template->assign_vars(array(

# 
#-----[ BEFORE, ADD ]------------------------------------------
# 

			if (intval($forum_id) != '')
			{
				$sql = "SELECT sponsor
					FROM " .  FORUMS_TABLE . "
					WHERE forum_id = " . $forum_id;
				if ( !$result = $db->sql_query($sql) )
				{
					message_die(GENERAL_ERROR, 'Could not select forum sponsor data', '', __LINE__, __FILE__, $sql);
				}
	
				while( $row = $db->sql_fetchrow($result) )
				{
					$forum_sponsor = $row['sponsor'];
				}
			}

# 
#-----[ AFTER, ADD ]------------------------------------------
#

				'SPONSOR'		=> $forum_sponsor,
                   'L_FORUM_SPONSOR' => $lang['Forum_Sponsor'],
#
#-----[ FIND ]------------------------------------------
# 

			$sql = "INSERT INTO " . FORUMS_TABLE . " (forum_id, forum_name, cat_id, forum_parent, forum_desc, forum_order, forum_status, prune_enable" . $field_sql . ")

#
#-----[ IN-LINE FIND ]---------------------------------
#

, prune_enable

#
#-----[ IN-LINE AFTER, ADD ]---------------------------
#

, sponsor

#
#-----[ FIND ]------------------------------------------
# 

VALUES ('" . $next_id . "', '" . str_replace("\'", "''", $HTTP_POST_VARS['forumname']) . "', " . $new_cat . ', ' . $new_parent . ", '" . str_replace("\'", "''", $HTTP_POST_VARS['forumdesc']) . "', $next_order, " . intval($HTTP_POST_VARS['forumstatus']) . ", " . intval($HTTP_POST_VARS['prune_enable']) . $value_sql . ")"

#
#-----[ IN-LINE FIND ]---------------------------------
#

intval($HTTP_POST_VARS['prune_enable'])

#
#-----[ IN-LINE AFTER, ADD ]---------------------------
#

 . ", '" . str_replace("\'", "''", $HTTP_POST_VARS['sponsor']) . "'"

#
#-----[ FIND ]------------------------------------------
# 

				SET forum_name = '" . str_replace("\'", "''", $HTTP_POST_VARS['forumname']) . "', cat_id = $new_cat, forum_parent = $new_parent, forum_desc = '" . str_replace("\'", "''", $HTTP_POST_VARS['forumdesc']) . "', forum_status = " . intval($HTTP_POST_VARS['forumstatus']) . ", prune_enable = " . intval($HTTP_POST_VARS['prune_enable']) . "

#
#-----[ IN-LINE FIND ]---------------------------------
#

" . intval($HTTP_POST_VARS['prune_enable']) . "

#
#-----[ IN-LINE AFTER, ADD ]---------------------------
#

, sponsor = '" . str_replace("\'", "''", $HTTP_POST_VARS['sponsor']) . "'

# 
#-----[ OPEN ]------------------------------------------
# 

includes/page_header.php

#
#-----[ FIND ]------------------------------------------
# 

//
// The following assigns all _common_ variables that may be used at any point
// in a template.
//

# 
#-----[ BEFORE, ADD ]------------------------------------------
# 

if (intval($forum_id) != '')
{
	$sql = "SELECT sponsor
		FROM " .  FORUMS_TABLE . "
		WHERE forum_id = " . $forum_id;
	if ( !$result = $db->sql_query($sql) )
	{
		message_die(GENERAL_ERROR, 'Could not select forum sponsor data', '', __LINE__, __FILE__, $sql);
	}

	while( $row = $db->sql_fetchrow($result) )
	{
		$forum_sponsor = $row['sponsor'];
	}
}

#
#-----[ FIND ]------------------------------------------
# 

$template->assign_vars(array(

# 
#-----[ AFTER, ADD ]------------------------------------------
#

	'FORUM_SPONSOR'		=> $forum_sponsor,

#
#-----[ FIND ]------------------------------------------
# 

	'L_USERNAME' => $lang['Username'],

# 
#-----[ AFTER, ADD ]------------------------------------------
#

	'L_FORUM_SPONSOR' => $lang['Forum_Sponsor'],

# 
#-----[ OPEN ]------------------------------------------
# 

language/lang_english/lang_main.php

#
#-----[ FIND ]------------------------------------------
# 

?>

# 
#-----[ BEFORE, ADD ]------------------------------------------
# 

$lang['Forum_Sponsor'] = 'Forum Sponsor';

# 
#-----[ OPEN ]------------------------------------------
# 

templates/subSilver/viewforum_body.tpl

#
#-----[ FIND ]------------------------------------------
# 

</table>

# 
#-----[ AFTER, ADD ]------------------------------------------
#

<table width="100%" cellspacing="1" cellpadding="2" border="0" align="center"> 
	<tr>
		<td align="center">
			{FORUM_SPONSOR}
		</td>
	</tr>
</table>

# 
#-----[ OPEN ]------------------------------------------
# 

templates/subSilver/viewtopic_body.tpl

#
#-----[ FIND ]------------------------------------------
# 

	  -> <a href="{U_VIEW_FORUM}" class="nav">{FORUM_NAME}</a></span></td>
  </tr>
</table>

# 
#-----[ AFTER, ADD ]------------------------------------------
#

<table width="100%" cellspacing="1" cellpadding="2" border="0" align="center"> 
	<tr>
		<td align="center">
			{FORUM_SPONSOR}
		</td>
	</tr>
</table>

# 
#-----[ OPEN ]------------------------------------------
# 

templates/subSilver/admin/forum_edit_body.tpl

#
#-----[ FIND ]------------------------------------------
# 

	  </table></td>
	</tr>

# 
#-----[ AFTER, ADD ]------------------------------------------
#

	<tr>
		<td class="row1">{L_FORUM_SPONSOR}</td>
		<td class="row2"><textarea rows="5" cols="45" wrap="virtual"  name="sponsor" class="post">{SPONSOR}</textarea></td>
	</tr>

#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM
Last edited by KMac on Thu Nov 02, 2006 5:45 pm, edited 1 time in total.
xcesiv
Registered User
Posts: 66
Joined: Sun Oct 22, 2006 7:27 am
Location: www.xcesiv.com
Contact:

Post by xcesiv »

I have the artemis skin on my site.

Im having trouble with the banners coming up centred

Can someone please help.
User avatar
EXreaction
Former Team Member
Posts: 5666
Joined: Sun Aug 21, 2005 9:31 pm
Location: Wisconsin, U.S.
Name: Nathan

Post by EXreaction »

xcesiv wrote: I have the artemis skin on my site.

Im having trouble with the banners coming up centred

Can someone please help.


Could you upload your viewforum_body.tpl and viewtopic.tpl files?
(don't post the code here, it takes up too much space. Either upload it to a free file hosting place, or email it to me at exreaction [at] lithiumstudios [dot] org)



KMac, thanks for that, I never looked into the simple subforums mod with this...maybe I will give it a look and try to make mine work better.
xcesiv
Registered User
Posts: 66
Joined: Sun Oct 22, 2006 7:27 am
Location: www.xcesiv.com
Contact:

Post by xcesiv »

Thank you for that. I appreciate your help.

Im email it now.
User avatar
EXreaction
Former Team Member
Posts: 5666
Joined: Sun Aug 21, 2005 9:31 pm
Location: Wisconsin, U.S.
Name: Nathan

Post by EXreaction »

xcesiv wrote: Thank you for that. I appreciate your help.

Im email it now.


Ok, I didn't see any problem with it...except that viewtopic_body.tpl is really different than subSilver's...

I added the code that was supposed to go in viewtopic_body.tpl after this code:

Code: Select all

	</form></span></td>
</tr>
</table>
It looks centered to me(if that does not work let me know and I will install the template and try it in more detail ;))
xcesiv
Registered User
Posts: 66
Joined: Sun Oct 22, 2006 7:27 am
Location: www.xcesiv.com
Contact:

Post by xcesiv »

did u send me the file back cause i didnt seem to receive anything.

Sorry

Here is the sites link at the moment as we have a DNS problem with the main domain

www.outsidetheloop.net/~xcesiv

Thanks again
User avatar
EXreaction
Former Team Member
Posts: 5666
Joined: Sun Aug 21, 2005 9:31 pm
Location: Wisconsin, U.S.
Name: Nathan

Post by EXreaction »

xcesiv wrote: did u send me the file back cause i didnt seem to receive anything.

Sorry

Here is the sites link at the moment as we have a DNS problem with the main domain

www.outsidetheloop.net/~xcesiv

Thanks again


No I didn't send it back...

You can do the changes it asks to viewforum_body.tpl and it should look right, and when you do the changes to viewtopic_body.tpl put the code after this:

Code: Select all

   </form></span></td>
</tr>
</table>
I also noticed that it's not possible for anyone to register(without knowing something about phpBB) on your site. On the first register page the only link you have is for "I do not agree" and that just brings people to the index. ;)
xcesiv
Registered User
Posts: 66
Joined: Sun Oct 22, 2006 7:27 am
Location: www.xcesiv.com
Contact:

Post by xcesiv »

I just saw that too in the Subsilver skin but we dont use that. I just had it on the subsilver skin while trying some mods out

On Artemis skin it has the 2 options, agree or dont agree.

Good pick up mate/
xcesiv
Registered User
Posts: 66
Joined: Sun Oct 22, 2006 7:27 am
Location: www.xcesiv.com
Contact:

Post by xcesiv »

i had my friend who knows phpbb alot better than i do redo the code and we still cant get it to align.

:S
User avatar
EXreaction
Former Team Member
Posts: 5666
Joined: Sun Aug 21, 2005 9:31 pm
Location: Wisconsin, U.S.
Name: Nathan

Post by EXreaction »

xcesiv wrote: i had my friend who knows phpbb alot better than i do redo the code and we still cant get it to align.

:S


Well, you will have to put an image or something in one of your public viewable forums so I can take a look at it and see what is happening. :)
xcesiv
Registered User
Posts: 66
Joined: Sun Oct 22, 2006 7:27 am
Location: www.xcesiv.com
Contact:

Post by xcesiv »

Here is a screen shot of wat it looks like
http://i48.photobucket.com/albums/f227/ ... enshot.gif

Here is a link to the forum
www.xcesiv.com
There are a lot of public areas u can look at. just look at the threads with more than 10 posts and u will see it.

thanks again
User avatar
EXreaction
Former Team Member
Posts: 5666
Joined: Sun Aug 21, 2005 9:31 pm
Location: Wisconsin, U.S.
Name: Nathan

Post by EXreaction »

xcesiv wrote: Here is a screen shot of wat it looks like
http://i48.photobucket.com/albums/f227/ ... enshot.gif

Here is a link to the forum
www.xcesiv.com
There are a lot of public areas u can look at. just look at the threads with more than 10 posts and u will see it.

thanks again


That is not from my mod at all.

My mod adds advertisement space above all of the posts. I believe the mod you are thinking of is the Inline Banner Ads mod?
xcesiv
Registered User
Posts: 66
Joined: Sun Oct 22, 2006 7:27 am
Location: www.xcesiv.com
Contact:

Post by xcesiv »

sorry man. I thought i set this one up.

ill ask in there
User avatar
Roks
Registered User
Posts: 119
Joined: Thu Sep 14, 2006 1:15 am

Post by Roks »

Thanks for the MOD.
killyouall
Registered User
Posts: 523
Joined: Tue Oct 18, 2005 3:04 am
Contact:

Post by killyouall »

ello i have a few questions does this work with simple subforums? and can you put more that one images or code in in the same topic and have it change like if you put three in there they randoily change to show differt ones on each load?
Post Reply

Return to “[2.0.x] MOD Database Releases”

cron