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.
Post Reply

Rating:

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

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 »

killyouall wrote: 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?


Try what KMac posted on the top of page 4. :)

No, it will not pick one ad at random. It will only show what you put in there.
killyouall
Registered User
Posts: 523
Joined: Tue Oct 18, 2005 3:04 am
Contact:

Post by killyouall »

is there anyway to make it go radom? can i call a script and make it do it that way?
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 »

killyouall wrote: is there anyway to make it go radom? can i call a script and make it do it that way?


Yes, it would be possible, if you make a .php file that randomly picks an image, and then like right to the image with the html img code.

If the image does not display because it doesn't accept .php as an image format, make the file that randomly picks an image named index.php and put it in a folder named something like image.gif(make it have a .gif or .jpg extension). Then just have the html point to that folder(not to index.php in it, just the folder with the extension).
killyouall
Registered User
Posts: 523
Joined: Tue Oct 18, 2005 3:04 am
Contact:

Post by killyouall »

thaks i downloaded it and put it on my mod to do list ill have to put together a script for it
killyouall
Registered User
Posts: 523
Joined: Tue Oct 18, 2005 3:04 am
Contact:

Post by killyouall »

KMac wrote: 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


just to make shure use this install file instead of the one with the download right??
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 »

Yes, that is the one that should work for simple subforums. But make sure you get a backup of the files and database in case something goes wrong. ;)
(I have not tested it so I can not guarantee anything)
killyouall
Registered User
Posts: 523
Joined: Tue Oct 18, 2005 3:04 am
Contact:

Post by killyouall »

looks like its fine i saw it when i went to make a forum but i havent tested it yet cause im getting ff12 today so my forum isnt gonna get updated for a few days *cough* and i havent made a script to make the random generation yet
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 »

killyouall wrote: looks like its fine i saw it when i went to make a forum but i havent tested it yet cause im getting ff12 today so my forum isnt gonna get updated for a few days *cough* and i havent made a script to make the random generation yet


I actually have one that I use for my signature. :)

http://www.lithiumstudios.org/files/other/rand_img.zip
killyouall
Registered User
Posts: 523
Joined: Tue Oct 18, 2005 3:04 am
Contact:

Post by killyouall »

how are you calling it to your sig?
nvm i looked at the image prop and figured it out


so im gonna suggest a feature request instead

1) maby allow php and other codes in the future
2) maby have a way to add categories also
3) and maby a option to have random images (ie where you enter a url and it adds it and its there for the randomness lol
4) *if you do the random banner thing have it so it dosent sow the url but instead it shows the url of the cat your at lol
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 »

killyouall wrote: 1) maby allow php and other codes in the future
2) maby have a way to add categories also
3) and maby a option to have random images (ie where you enter a url and it adds it and its there for the randomness lol
4) *if you do the random banner thing have it so it dosent sow the url but instead it shows the url of the cat your at lol


BBCode support is included in the next version(it will be out when the Mod Team approves it(which should have been a while ago). I don't think I will ever let it support php, and I don't know how I even would do that right now.

Add Categories?

No, I am not going to have multiple/random images for this mod. It is a Forum Sponsor mod, not an advertisement manager(would need a complete overhaul to support that other stuff, something I do not have the time to do).
killyouall
Registered User
Posts: 523
Joined: Tue Oct 18, 2005 3:04 am
Contact:

Post by killyouall »

ah ok i think i saw a mod that allws bbcode in the forum so ill look for it lol
was was worth a try though lol
ycl6
Translator
Posts: 5696
Joined: Sat Feb 15, 2003 10:35 am
Location: Taiwan
Contact:

Post by ycl6 »

MOD Updated to version 1.0.02c
See first post for Download Link
killyouall
Registered User
Posts: 523
Joined: Tue Oct 18, 2005 3:04 am
Contact:

Post by killyouall »

whats the code changes and is there and update for the subforum update too? or did you maby make a add on for it
Bud Wiser
Registered User
Posts: 14
Joined: Sun May 22, 2005 8:20 pm

TOTAL NOOB NEEDS HELP!

Post by Bud Wiser »

Ok, I read this whole thread, I must be a total boob, because I can not figure out how to make this work.

I can install add ons and mods on lots of forums, but the instructions here is not clear to me.

Wouldn't a step by step instructions be a good idea for each mod?

Where do I upload the xml and xsl files????

I've done the manual mod changes to all the files, and see the new box, although it doesn't say sponsors.

I tried to add my google code there, but it does not show.

I uploaded the xml and xsl file in the main root.

Pls any help would be greatly appreciated and keep in mind I am not fimilar with any phpbb modes.

Thank you in advance!
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 »

killyouall wrote: whats the code changes and is there and update for the subforum update too? or did you maby make a add on for it


The upgrades are in the contrib/upgrades folder.

And no, I did not get a chance to look into the simple subforums mod.


Bud Wiser wrote: Ok, I read this whole thread, I must be a total boob, because I can not figure out how to make this work.

I can install add ons and mods on lots of forums, but the instructions here is not clear to me.

Wouldn't a step by step instructions be a good idea for each mod?

Where do I upload the xml and xsl files????

I've done the manual mod changes to all the files, and see the new box, although it doesn't say sponsors.

I tried to add my google code there, but it does not show.

I uploaded the xml and xsl file in the main root.

Pls any help would be greatly appreciated and keep in mind I am not fimilar with any phpbb modes.

Thank you in advance!


There are step by step instructions...just like every other mod in the mods database. ;)

The XML and XSL are just a different format(ModX) instead of having it as the other plain text format(plain text instructions are in the contrib/ folder). You may open the XML file with any web browser(like Firefox or IE) and you will see...

Are you running the latest version of this mod? If you are not, upgrade, then try it again.
Post Reply

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