Uutiset:

Wondering if this will always be free?  See why free is better.

Main Menu
Advertisement:

Adding AD MOD to Dark4 theme

Aloittaja bburg5, marraskuu 03, 2011, 08:51:59 IP

« edellinen - seuraava »

bburg5

I am having trouble adding the AD MOD to the Dark4 theme. When I add the the code to the Index.Template file I get a parse error and then end up having to restore the file so that I do not get the error. Would anyone be willing to look at my file and see where the ad mod codes need to be?

./Themes/{your_theme}/index.template.php

Find:

Code:

<body>';

Replace with:

Code:

<body>';

//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);
}

Find:

Code:

</td>

Replace with:

Code:

</td>';
//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);
}
echo '

Find:

Code:

template_menu();

Replace with:

Code:

template_menu();

//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:

Code:

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


Replace with:

Code:


//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);
}

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




Thanks

mashby

I have a feeling you are having issues with this part, right?
Find:

Code:

</td>

Replace with:

Code:

</td>';
//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);
}
echo '
The find/replace is for the default theme and all of the edits you have so far are fine with the exception of the above and the area around template_menu. I'm wondering which part those ads would appear in? Welcome ads makes me think the top. Mind supplying a link to your site? I've also attached something without the above included.
Always be a little kinder than necessary.
- James M. Barrie

bburg5

Thanks you so much for even looking into this for me...


My test site is Test Site

I will look at the code you have supplied and see if it works with what issues I was having.

Not sure if it was the welcom ad area or what.

Thanks again.

bburg5

#3
Great it worked-   ;D

I have not tried the different ad placings, but the Parse error does not happen this time...

Going back to run some tests...!!!

THANK YOU

Okay now running into a couple errors-
-No ads between cats. no code in other files must have returned them to normal also...
-errors in database now... Fixed by deleting (a.file_hash,) in display.php
-now ads below last post
Going to continue looking...

bburg5

#4
seems as if I got them working now, but can you look at the ads and see what or if I can get them only to bein the the message table are and not outside and centered in table?

Thanks


EDIT- fixed with cell pad change-

Thank you again- I have been struggling for awhile now to get this done. I know I would need to post in another topic, but can you have your images shrink with your forum when on smaller res. screens? If so I will ask in another topic.

Thanks

Advertisement: