Ad Management mod

Started by SMFHacks.com Team, January 30, 2006, 08:41:19 PM

Previous topic - Next topic

BAMAVAMP

yes it works in the default just fine. It was installed originally while we were using the default and still works now cause I checked after I couldn't do it with the new theme.

Smitten

Quote from: John Kitchens on September 03, 2009, 10:57:22 PM
Hey Smitten,

I am glad you solved your problem. Please post the solution for the others here that will need it.

John Kitchens

For Kani119 Theme: INDEX.TEMPLATE.PHP

FIND:

<body>
  <div id="wrapper"/>
  <div id="head-l">
<div id="head-r">
  <div id="header">
  <div id="userarea">';
if ($context['user']['is_logged'])
{
echo '<b>', $txt['hello_member_ndt'], ' ', $context['user']['name'], '</b><br />';


ADD AFTER:

//Display ads on the top of the page
if (function_exists("show_topofpageAds"))
{
$ads = show_topofpageAds();
if(!empty($ads))
if($ads['type']==0)
echo $ads['content'];
else
eval($ads['content']);
unset($ads);
}

//Welcome Ads
if (function_exists("show_welcomeAds"))
{
$ads = show_welcomeAds();
if(!empty($ads))
{
echo '<td class="windowbg2">';
if($ads['type']==0)
echo $ads['content'];
else
eval($ads['content']);
echo '</td>';
}
unset($ads);
}


FIND:

<div id="mainarea">
<div id="sag">
<div id="sol">
  <div id="alt">
<div id="altsag">
<div id="altsol">
  <div id="ust">
<div id="ustsag">
<div id="ustsol">';
                                                  }


ADD AFTER:

//Below the menu ads
if (function_exists("show_indexAds") && function_exists("show_towerleftAds") && function_exists("show_towerrightAds"))
{
$ads = show_indexAds();
if(!empty($ads))
if($ads['type']==0)
echo $ads['content'];
else
eval($ads['content']);
unset($ads);

//Tower left Ads
$ads = show_towerleftAds();
if(!empty($ads))
echo '<table><tr><td valign="top">', $ads['type']==0 ? $ads['content'] : eval($ads['content']) ,'</td><td width="100%" valign="top">';

unset($ads);
//Tower Right Ads
$ads = show_towerrightAds();
if(!empty($ads))
echo '<table><tr><td width="100%" valign="top">';
unset($ads);
}


FIND:

// Show the "Powered by" and "Valid" logos, as well as the copyright. Remember, the copyright must be somewhere!

ADD BEFORE:

//Close table for towerright ads
if (function_exists("show_towerrightAds") && function_exists("show_towerleftAds") && function_exists("show_bottomAds"))
{
$ads = show_towerrightAds();
if(!empty($ads))
echo '</td><td valign="top">', $ads['type']==0 ? $ads['content'] : eval($ads['content']) ,'</td></tr></table>';

unset($ads);
//Close table for towerleft ads
$ads = show_towerleftAds();
if(!empty($ads))
echo '</td></tr></table>';
unset($ads);

//Show ads on the bottom of the page
$ads = show_bottomAds();
if(!empty($ads))
if($ads['type']==0)
echo $ads['content'];
else
eval($ads['content']);
unset($ads);
}


DISPLAY.TEMPLATE.PHP

FIND:

function template_main()
{
global $context, $settings, $options, $txt, $scripturl, $modSettings;


ADD AFTER:


//Display ads on the thread page
if (function_exists("show_threadAds"))
{
$ads = show_threadAds();
if(!empty($ads))
if($ads['type']==0)
echo $ads['content'];
else
eval($ads['content']);
unset($ads);
}


FIND:

// Get all the messages...
while ($message = $context['get_message']())
{


REPLACE WITH

//Ad Counter
$adcounter =0;
// Get all the messages...
while ($message = $context['get_message']())
{
$adcounter++;


FIND:

// Show the member's signature?
if (!empty($message['member']['signature']) && empty($options['show_no_signatures']))
echo '
<hr width="100%" size="1" class="hrcolor" />
<div class="signature"><center>', $message['member']['signature'], '</center></div>';

echo '
</td>
</tr>
</table>
</td></tr>
<tr>
<td class="windowbg3"><br />
</td>
</tr>
</table>


ADD AFTER:

</td></tr>';
if (function_exists("show_posts"))
{
if ($adpost = show_posts($adcounter))
{
if($modSettings['ads_lookLikePosts'])
{
echo '

<tr><td style="padding: 1px 1px 0 1px;">
<table width="100%" cellpadding="3" cellspacing="0" border="0">
<tr><td class="windowbg3">
<table width="100%" cellpadding="5" cellspacing="0" style="table-layout: fixed;">
<tr>
<td valign="top" width="16%" rowspan="2" style="overflow: hidden;">
<b>', $context['forum_name'], '</b>
<div class="smalltext">
</div>
</td>
<td valign="top" width="85%" height="100%">
<table width="100%" border="0"><tr>
<td valign="middle"><img src="', $message['icon_url'] . '" alt="" border="0" /></td>
<td valign="middle">
<div style="font-weight: bold;" id="subject_', $message['id'], '">
<a href="', $message['href'], '">', $message['subject'], '</a>
</div>
<div class="smalltext">&#171; <b>', !empty($message['counter']) ? $txt[146] . ' #' . $message['counter'] : '', ' ', $txt[30], ':</b> ', $message['time'], ' &#187;</div></td>
<td align="', !$context['right_to_left'] ? 'right' : 'left', '" valign="bottom" height="20" style="font-size: smaller;">';
if ($context['can_reply'] && !empty($options['display_quick_reply']))
echo '
', $reply_button, '';

// So... quick reply is off, but they *can* reply?
elseif ($context['can_reply'])
echo '
', $reply_button, '';

// Can the user modify the contents of this post?
if ($message['can_modify'])
echo '
', $modify_button, '';

// How about... even... remove it entirely?!
if ($message['can_remove'])
echo '
', $remove_button, '';

// What about splitting it off the rest of the topic?
if ($context['can_split'])
echo '
', $split_button, '';
echo '
</td>
</tr></table>
<hr width="100%" size="1" class="hrcolor" />
<div class="post">', $adpost['type'] == 0 ? $adpost['content'] : eval($adpost['content']) , '</div>
</td>
</tr>
<tr>
<td valign="bottom" class="smalltext" width="85%">
<table width="100%" border="0" style="table-layout: fixed;"><tr>
<td colspan="2" class="smalltext" width="100%">
</tr><tr>
<td valign="bottom" class="smalltext" id="modified_', $message['id'], '">
</td>
<td align="', !$context['right_to_left'] ? 'right' : 'left', '" valign="bottom" class="smalltext">
<img src="', $settings['images_url'], '/ip.gif" alt="" border="0" />&nbsp;', $txt[511], '
</td>
</tr></table>
</tr>
</table>
</td></tr>
</table>
</td></tr>';
}
else
echo '
<tr><td style="padding: 1px 1px 0 1px;">
<table width="100%" cellpadding="3" cellspacing="0" border="0">
<tr>
<td class="windowbg3">', $adpost['type'] == 0 ? $adpost['content'] : eval($adpost['content']) , '</td>
</tr>
</table>
</td></tr>';
}

}

}

if(function_exists("show_lastpostAds") && function_exists("show_posts"))
{
if(($ads = show_lastpostAds()) && !show_posts($adcounter))
{
if($modSettings['ads_lookLikePosts'])
{
echo '

<tr><td style="padding: 1px 1px 0 1px;">
<table width="100%" cellpadding="3" cellspacing="0" border="0">
<tr><td class="windowbg3">
<table width="100%" cellpadding="5" cellspacing="0" style="table-layout: fixed;">
<tr>
<td valign="top" width="16%" rowspan="2" style="overflow: hidden;">
<b>', $context['forum_name'], '</b>
<div class="smalltext">
</div>
</td>
<td valign="top" width="85%" height="100%">
<table width="100%" border="0"><tr>
<td valign="middle">&nbsp;</td>
<td valign="middle">
&nbsp;</td>
<td align="', !$context['right_to_left'] ? 'right' : 'left', '" valign="bottom" height="20" style="font-size: smaller;">';
if ($context['can_reply'] && !empty($options['display_quick_reply']))
echo '
', $reply_button, '';

// So... quick reply is off, but they *can* reply?
elseif ($context['can_reply'])
echo '
', $reply_button, '';


echo '
</td>
</tr></table>
<hr width="100%" size="1" class="hrcolor" />
<div class="post">', $ads['type'] == 0 ? $ads['content'] : eval($ads['content']) , '</div>
</td>
</tr>
<tr>
<td valign="bottom" class="smalltext" width="85%">
<table width="100%" border="0" style="table-layout: fixed;"><tr>
<td colspan="2" class="smalltext" width="100%">
</tr><tr>
<td valign="bottom" class="smalltext" id="modified_', $message['id'], '">
</td>
<td align="', !$context['right_to_left'] ? 'right' : 'left', '" valign="bottom" class="smalltext">
<img src="', $settings['images_url'], '/ip.gif" alt="" border="0" />&nbsp;', $txt[511], '
</td>
</tr></table>
</tr>
</table>
</td></tr>
</table>
</td></tr>';
}
else
echo '
<tr><td style="padding: 1px 1px 0 1px;">
<table width="100%" cellpadding="3" cellspacing="0" border="0">
<tr>
<td class="windowbg3">', $ads['type'] == 0 ? $ads['content'] : eval($ads['content']) , '</td>
</tr>
</table>
</td></tr>';

}

}


BOARDINDEX.TEMPLATE.PHP

FIND:

// Show some statistics next to the link tree if SP1 info is off.

ADD BEFORE:


//Display ads on the board index
if (function_exists("show_boardAds"))
{
$ads = show_boardAds();
if(!empty($ads))
if($ads['type']==0)
echo $ads['content'];
else
eval($ads['content']);
unset($ads);
}


FIND:

// Sort the links into an array with new boards bold so it can be imploded.
$children = array();
/* Each child in each board's children has:
id, name, description, new (is it new?), topics (#), posts (#), href, link, and last_post. */
foreach ($board['children'] as $child)
{
$child['link'] = '<a href="' . $child['href'] . '" title="' . ($child['new'] ? $txt[333] : $txt[334]) . ' (' . $txt[330] . ': ' . $child['topics'] . ', ' . $txt[21] . ': ' . $child['posts'] . ')">' . $child['name'] . '</a>';
$children[] = $child['new'] ? '<b>' . $child['link'] . '</b>' : $child['link'];
}

echo '
<tr>
<td colspan="3" class="windowbg', !empty($settings['seperate_sticky_lock']) ? '3' : '', '">
<span class="smalltext"><b>', $txt['parent_boards'], '</b>: ', implode(', ', $children), '</span>
</td>
</tr>';
}
}
echo '
</table>';
}
echo '
</div>';


ADD AFTER:


//Display ads Between cats
if (function_exists("show_category"))
{
$ads = show_category($category['id']);
if(!empty($ads))
if($ads['type']==0)
echo $ads['content'];
else
eval($ads['content']);
unset($ads);
}


icecopi

I see some SMF users have under the ads a solid colour background.  Can someone tell me how this is done?

hellokitty1234

My custom theme has no display.template.php file So how would I stall the ad mod? Please help

hellokitty1234

I forgot to mention im using smf 1.1.10

hellokitty1234

Here are 3 of the 4 files the ad mod says I have to edit. In one of them (index)  there isn't even a "<body>';" to be found. If someone could edit them for me and point me in  the right direction. Your help would greatly be appreciated.

Rohan_

#4126
hi ... i am editing my index.template.php and i am using 1.1.10 .. so ur mod needs to find
</td>

but i cant find it there .. what do i do now ?? please help
Proud To Be An Indian

sipo

Hello, can anyone help me, only admins can see the ads on my site, how do I change it so all users see it ?

thanks :)

hellokitty1234

QuoteHello, can anyone help me, only admins can see the ads on my site, how do I change it so all users see it ?

thanks :)


Try going to permissions and giving the usergroup permission

bellamandu

Can someone help me please? im not sure if i am doing this right, im sorta new at this kind of stuff.

i uploaded the files to the correct folders on my server, but when i try to run install.php i get this:

Fatal error: Call to undefined function db_query() in /www/vndv.com/e/t/e/eternalreign/htdocs/forum/Themes/default/install.php on line 6

what do i need to do to fix this? i cant even get it to install. am i doing this right?

Rohan_

hey bellamandu u are doing wrong man .. just go in your admin > packages > download > then upload the zip file there then u can easily install that :)
Proud To Be An Indian

sipo

Quote from: hellokitty1234 on September 06, 2009, 07:01:31 PM
QuoteHello, can anyone help me, only admins can see the ads on my site, how do I change it so all users see it ?

thanks :)


Try going to permissions and giving the usergroup permission

Oh, great, I did not know that was there, thank you a lot :)

bellamandu

Quote from: Rohan_ on September 07, 2009, 04:03:40 AM
hey bellamandu u are doing wrong man .. just go in your admin > packages > download > then upload the zip file there then u can easily install that :)

ok, so i tried that but it wont let me upload .zip files. is there any other way to do this?

bellamandu

ok, i found out that my server has zlib disabled and wont enabled it for whatever reason..

how can i manually install this mod?

FeDe.RuLeZ

Hi i have a problem. I have installed the mod manually because i have problems with the Package Manager.
I did every step i run the query etc etc, but i have a problem. When i try to access to the admin page of the mod i have an error: "Cannot load 'main' template".

Please help me and sorry for my english!

~ Forum Support  ~ News  ~ Download Center  ~ Media Center  ~ Link Directory  ~ Arcade  ~ Anche Supporto SMF!

clewis789

i keep getting this error while upload, "Could not upload package, please check directory permissions" how do i fix it ?
My Mods:

Playstation 3 Avatars - http://custom.simplemachines.org/mods/index.php?mod=2150

Xbox 360 Avatars - Will be up very soon.

Nintendo Wii Avatars - Coming Soon

Rohan_

go in packages > option > standard files are writable
Proud To Be An Indian

FeDe.RuLeZ

Someone can help me please?

~ Forum Support  ~ News  ~ Download Center  ~ Media Center  ~ Link Directory  ~ Arcade  ~ Anche Supporto SMF!

Games4Nerds

Hi guys, i need help with something, i installed the ad mod and everything is good, except that the ads only show up when i log in to my forum. Is there a way to make it so ads are shown even when not logged in? ???

Thanks
Games4nerds.net

Rohan_

go in permissions > guests
Proud To Be An Indian

 
Advertisement: