SMF Ads Support Forum

Themes/Language => Theme Support => Topic started by: bigguy on June 20, 2006, 07:26:59 am

Title: Edits for ad_mod_rc2_v2 for themes other than default
Post by: bigguy on June 20, 2006, 07:26:59 am
These are the default edits for the ad mod taken right from the install.xml file. These are the edits you should do on other themes, as all the other edits will install fine.

In your theme directory you want to modify, in "index.template.php" find:

Code: [Select]
<body>';
After that line add:

Code: [Select]
//Display ads on the top of the page
$ads = show_topofpageAds();
if(!empty($ads))
if($ads['type']==0)
echo $ads['content'];
else
eval($ads['content']);
unset($ads);

Then find in the same file:

Code: [Select]
</td>
BEFORE that add:

Code: [Select]
';
//Welcome Ads
$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 '

In the same file search for:

Code: [Select]
template_menu();
Then add BEFORE:

Code: [Select]
//Below the menu ads
$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);

In the same file Find:

Code: [Select]
// Show the "Powered by" and "Valid" logos, as well as the copyright. Remember, the copyright must be somewhere!
After that add:

Code: [Select]
//Close table for towerright ads
$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);

ABOVE ARE THE EDITS FOR THE INDEX.TEMPLATE.PHP FILE

In "BoardIndex.template.php" find:

Code: [Select]
// Show some statistics next to the link tree if SP1 info is off.
Add after that:

Code: [Select]
//Display ads on the board index
$ads = show_boardAds();
if(!empty($ads))
if($ads['type']==0)
echo $ads['content'];
else
eval($ads['content']);
unset($ads);

ABOVE IS THE EDIT FOR THE BoardIndex.template.php


In "Display.template.php" FIND:

Code: [Select]
global $context, $settings, $options, $txt, $scripturl, $modSettings;
BEFORE that add:

Code: [Select]
//Display ads on the thread page
$ads = show_threadAds();
if(!empty($ads))
if($ads['type']==0)
echo $ads['content'];
else
eval($ads['content']);
unset($ads);

In the same file FIND:

Code: [Select]
// Get all the messages...
And REPLACE with:

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

In the same file find:

Code: [Select]
</td></tr>';
}

And REPLACE with:

Code: [Select]
</td></tr>';
if ($adpost = show_posts($adcounter))
{
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">? <b>', !empty($message['counter']) ? $txt[146] . ' #' . $message['counter'] : '', ' ', $txt[30], ':</b> ', $message['time'], ' ?</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>';
}

}

ABOVE ARE THE EDITS FOR THE DISPLAY.TEMPLATE.PHP

In "MessageIndex.template.php" Find:

Code: [Select]
global $context, $settings, $options, $scripturl, $modSettings, $txt;
BEFORE that add:

Code: [Select]
//Display Ads on the Message index
$ads = show_threadindexAds();
if(!empty($ads))
if($ads['type']==0)
echo $ads['content'];
else
eval($ads['content']);
unset($ads);

NOTE: If you cannot find the "Ad management" link in the admin panel, move your "Modifications.english.php file from your default language directory to the language directory of the theme you are modifying.
Title: Re: Edits for the default theme
Post by: Jump1979man on June 20, 2006, 08:03:15 pm
thank you for this.  I will try it soon to see if I can get it to work.
Title: Re: Edits for the default theme
Post by: bigguy on June 21, 2006, 09:14:35 am
Make sure the mod is installed first and then edit the template you want to use with these edits.
Title: Re: Edits for the default theme
Post by: ingaffa on June 23, 2006, 06:04:32 pm
Quote
Then find in the same file:

Quote
                     </td>

Which one?  There are hundreds!

Thanks.
Title: Re: Edits for the default theme
Post by: jerm on June 23, 2006, 06:08:50 pm
search for this instead:
Code: [Select]
</td>only one line will show up
Title: Re: Edits for the default theme
Post by: erik on June 24, 2006, 01:46:02 am
search for this instead:
Code: [Select]
</td>only one line will show up

It's inside the userbox at the top. Some themes doesn't have it
Title: Re: Edits for the default theme
Post by: bigguy on June 24, 2006, 10:29:59 am
Leaving this edit out won`t effect the ad mod at all, it will still run. You just won`t be able to show the ad`s there. What theme are you installing this on ??
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: willi1 on July 07, 2006, 05:55:41 am
Hello,

i have instialled the mod vers 2.0 can you help me i want to use the mod with the theme classic in german
i don?t know what i must do, i read this post but the settings in  the index.template.php are different
and i?m a newbie  ???

can you explain me waht i must do?

sorry for my bad english

best regards

willi1

Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: bigguy on July 07, 2006, 07:44:12 am
Install the ad mod to the default theme and then to the theme you want to use do the edits above. The edits above are for version 2 of the mod and will only work on smf 1.1rc2. I don`t think we have a german translation yet though.
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: willi1 on July 10, 2006, 12:13:14 am
Hello bigguy,

i have install the mod to the theme that i want to use and to the default theme.
but i can?t see the ads in the Forum can you help me what i must change in my classic theme?

The settings in the first entry?

best regards

willi1
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: bigguy on July 10, 2006, 08:51:44 am
All the edits for that that have to be made are above. You have to modify all the template files listed.
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: willi1 on July 12, 2006, 09:14:54 am
Hej Hej,

i have a question, i don?t have this line in my index.template.php

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

and the

Quote
</td>

i have many </td> in my index.template.php which one schould i use?

can you help me again?

thank you for your great mod

willi1
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: bigguy on July 12, 2006, 10:30:21 am
The //show the powered by stuff will have to be there somewhere, what theme are you using ??? also try searching for this:

Quote
                     </td>

search for it with the space, thats very important.
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: willi1 on July 12, 2006, 12:32:50 pm
Quote
The //show the powered by stuff will have to be there somewhere, what theme are you using Huh? also try searching for this:

Quote
                     </td>

search for it with the space, thats very important.

Hello bigguy,

i use the classic template

and my Adress is http://www.preishals.de

ok i will search for this.

i have attached the index.template.php perhaps you can look of this sorry for my english

best regards

Andr?



Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: bigguy on July 12, 2006, 01:10:13 pm
Try this one out...
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: willi1 on July 12, 2006, 01:59:13 pm
thank you very much bigguy,

it looks like good  :) , i will test it the next days.

best regards

Andr?

Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: bigguy on July 12, 2006, 02:12:24 pm
Glad to be of help ;)
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: willi1 on July 17, 2006, 12:09:06 pm
thank you bigguy,

now it works all  :)


best regards Andr?

thanks for the great mod to Jerm

Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: redstorm on July 19, 2006, 09:15:12 am
hi, i'm using Ancient and Rusted theme, can you help me?

http://themes.simplemachines.org/index.php?action=download;lemma=100;id=475
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: bigguy on July 19, 2006, 09:42:19 am
All the edits are on the first post of this thread. What type of help would you like.
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: Lorddraco on July 20, 2006, 10:27:18 am
Using Babylon theme, simple theme but found nicer than standard. But takes me few hours of scratching head still unable to modify the theme for the ad. Can help? I am not that good in scripting.
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: bigguy on July 20, 2006, 10:55:07 am
Do you have the ad mod installed. ??? What other mods do you have installed along with this one.
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: Lorddraco on July 20, 2006, 11:07:00 am
Do you have the ad mod installed. ??? What other mods do oyu have installed along with this one.

Yup ... ad_mod installed. But the modification of your ad_mod is done for default.

I dont have any other themes. Thanks  :P
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: bigguy on July 20, 2006, 01:35:00 pm
Ok, go to the first post on this topic and you will have to add the code manually to the template files in the Babylon theme folder. Only add the edits to the templates that exsist in that folder, all other edits are done.
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: SLiM_BoY on July 24, 2006, 03:40:52 pm
Ok, go to the first post on this topic and you will have to add the code manually to the template files in the Babylon theme folder. Only add the edits to the templates that exsist in that folder, all other edits are done.

I'm using Babylon theme too.But I can't find

Quote
                                                        </td>

At which line it's placed ?
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: SLiM_BoY on July 24, 2006, 03:56:41 pm
I think it's so difficult to edit Babylon theme..Because this theme doesn't have more then 2-3 codes.
Then, I'll be so happy if anybody can upload modified Babylon theme files  :-\ :-*
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: bigguy on July 24, 2006, 04:43:54 pm
I talked to you on msn I think.

I think it's so difficult to edit Babylon theme..Because this theme doesn't have more then 2-3 codes.
Then, I'll be so happy if anybody can upload modified Babylon theme files  :-\ :-*
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: SLiM_BoY on July 24, 2006, 05:20:58 pm
Yep, bigguy helped me on msn..Thank you so much dear ;)

Here, I attached Babylon theme modified files for ad_mod :
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: bigguy on July 24, 2006, 05:24:05 pm
I`m going to move these into there own post
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: SLiM_BoY on July 25, 2006, 02:17:38 pm
Oops..I think we've another problem with this mod.Administrator's can see the ads.But users can't see adsense ads with this mod..What should we do ?
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: bigguy on July 25, 2006, 04:31:52 pm
Set your permissions for each membergroup to see the ads.
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: Cholo on August 11, 2006, 04:25:25 pm
 Hey bigguy, I'm running the Dilber MC theme and I'm still confused about that </td> that I need to find. Could you help me locate exactly which one I'm looking for? Thanks a bunch.
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: bigguy on August 11, 2006, 05:39:37 pm
There will only be a few that have the space infront of it. Thats what you have to look for.

Quote
      </td>
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: Cholo on August 11, 2006, 06:33:50 pm
 Then do I add code after each one I find with the space in front of it? or just the first? Could you please show me a little more of the code that goes before and after that particular "</td>?
-I just got done editing the boardindex.template.php and I've noticed that I can't find any display.template.php -->Was there one to begin with? or did something happen, bc now I've got "error_log" in bold black there. This has got me worried, I appreciate all your help already. Thanks  :'(
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: bigguy on August 11, 2006, 09:39:27 pm
Any template files that you dont find in a theme you are trying to modify means that smf is reading from the "Default" theme templates, so there is no reason to edit or try to find files that aren`t there. I will look in my index.template.php and find the position of the code for you. hold on for a minute or 3. :)
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: bigguy on August 11, 2006, 09:48:34 pm
In the dilberMC theme in the Index.template.php find:

Code: [Select]
<td valign="middle" height="30" class="smalltext" style="padding-left:10px; padding-top:0px; padding-bottom:0px;">
<b>', $txt[102], '</b>: ', $context['random_news_line'], '
</td>
';

After that put:

Code: [Select]
        //Welcome Ads
$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 '
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: Cholo on August 11, 2006, 10:00:26 pm
Thanks a ton, I'll do that- I've been waiting for you to get on here all day. haha.
 Hey, two more questions
-So, I need to edit the display.template.php in the default theme? (I was just wondering about that template bc the Classic Yabbse      theme and the Babylon theme have that template, but I guess Dilber MC does not).
-My ads (on the bottom of the page) are off to the left; of course I'm not done with all the edits yet-Should they center themselves  when I'm done or do I need to do something else? Thanks again!

-oh yeah, and so I shouldn't be scared of the "error_log"?
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: Cholo on August 11, 2006, 10:15:11 pm
  I put it here-this is what my code looks like now. I saved the changes and I got a parse template error. Or parse code, I forget. haha.



          </td>
         ';
     //Welcome Ads
         $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 '
 
 

        echo '
            </form>
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: bigguy on August 11, 2006, 10:28:52 pm
Putting center tags around the ad code should center it. Did you find the code I talked about and place the ad code in the right spot ??? I can`t help but seeing this in your code:

Code: [Select]
</form>
that is not part of the ad code or the template i don`t think. ( I closed my editor but I didn`t see that anywhere)
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: Cholo on August 12, 2006, 12:21:23 am
 Yeah, that part is just the code that follows where I put in the part you told me to.  My forum's not showing up now-parse template error  >:(
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: bigguy on August 12, 2006, 12:35:18 am
Did you place it like I said 5 posts up ???
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: Cholo on August 12, 2006, 12:54:58 pm
1.  Just like that, and it screwed up my template for some reason  :-\  RebelRose gave me her template and I just overwrote my messed up one with hers and now I'm fine. I am still wanting to finish doing the edits I need for the ad mod, so I guess I'll just try it again.
2. So bigguy, for the ad mod, what I need to do is edit the templates of the Dilber MC theme, right? Except for the files that it doesn't have, like display.template.php -- with that file (for example) I need to edit the default files. correct?
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: bigguy on August 12, 2006, 12:58:51 pm
When you install a modification through the package manager it modifies the default theme so no you don`t have to touch the default templates unless the mod didn`t install right. All you need to edit is the temlpate files in the DilberMC theme folder.

EDIT: And maybe the Modifications.english.php file
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: Cholo on August 12, 2006, 10:02:30 pm
 In your instructions for editing modified themes, it calls for editing the "display.template.php" file. My Dilber MC theme doesn't have that file. So does that mean I go look for that file in the default theme and edit it there? or does that mean that I just don't make the edits to display.template.php?
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: bigguy on August 12, 2006, 10:23:24 pm
When you install a modification through the package manager it modifies the default theme so no you don`t have to touch the default templates unless the mod didn`t install right. All you need to edit is the temlpate files in the DilberMC theme folder.

EDIT: And maybe the Modifications.english.php file

Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: Cholo on August 13, 2006, 12:36:07 am
that's just the thing though, the mod didn't install right. Isn't that why this thread gives instructions on how to manually edit the code to get the ad management mod to work right on custom themes? Maybe I'm just not understanding something. Sorry if I'm being a pain taking up all this space.
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: bigguy on August 13, 2006, 01:09:44 am
Your not being a pain at all. This is what we are here for. Yes that is why this thread is here, so you can add the edits yourself. All these edits were taken from the install.xml file of the mod itself. Which if it is a default install will install seamlessly into the default theme. Add the edits to the "display.template.php" file as required. You should be fine.
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: Cholo on August 13, 2006, 12:39:01 pm
 Alright thanks bigguy. I'll be going back and making sure I did the edits right on the Dilber MC templates, and then I'll go ahead and do the edits to the default theme's display.template file. Thanks.      But I still don't know why I have the "error_log". Any ideas?
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: bigguy on August 13, 2006, 07:09:14 pm
What are the errors in the log. ???
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: Cholo on August 14, 2006, 01:37:27 pm
uh, let me check...
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: Cholo on August 14, 2006, 01:40:33 pm
It's weird..     I go to Themes and Layout, Modify Themes, Dilber MC.  Right there in my list of templates and files, there's "error_log", but it's in black- it's not a link to anything, it's just there. I'll get you a screen shot if you think it would help.
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: bigguy on August 14, 2006, 02:24:28 pm
Yes please, it might.
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: Cholo on August 14, 2006, 03:11:43 pm
Well, since I'm still not understanding screenshots (haha), hopefully this will do:


images   
languages   
BoardIndex.template.php                   August 11, 2006, 07:23:47 PM 22.65 KB
DilberMC.xml                                   July 18, 2006, 01:00:23 PM 6.67 KB
error_log                                        July 18, 2006, 09:16:58 PM 459 B
index.php                                       July 18, 2006, 10:07:22 PM 217 B
index.template.php                          August 12, 2006, 02:22:53 AM 37.29 KB
MessageIndex.template.php               July 18, 2006, 10:07:56 PM 25.58 KB
package-info.xml                             July 18, 2006, 01:00:25 PM 781 B
readme.txt                                     July 18, 2006, 01:00:26 PM 598 B
Settings.template.php                      July 18, 2006, 10:07:56 PM 6.57 KB
style.css 

 Everything I can click on and go to a file, except "error_log"- it just shows up in bold.
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: bigguy on August 14, 2006, 03:31:41 pm
That`s not were the error log is though. The errors I was referring to show up in the admin panel down at the bottom under "Maintenance" click on "Forum error log"
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: Cholo on August 14, 2006, 03:48:01 pm
Oh, I can show you those if you want. This was the error I was talking about though. Is that ok to have that "error_log" there where all the template files are?
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: Cholo on August 14, 2006, 03:50:08 pm
And this is the error I get when I try that 2nd edit - the "</td>" edit:

"The file you tried to save generated the following error:
Parse error: syntax error, unexpected T_CLASS, expecting ',' or ';' in index.template.php on line 247"

 I just tried it on a test forum with no mods except the "PM on registration" mod.
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: bigguy on August 14, 2006, 04:19:42 pm
Ok, Have you sent me your template files yet ??? If not post them here and I will get to them tonight I hope.
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: Cholo on August 14, 2006, 05:10:48 pm
 I haven't done that yet. I can go ahead and do that today. Thanks again for all your help. You're very cool 8) . But seriously, thanks for the help.
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: Cholo on August 15, 2006, 05:01:24 pm
 Here they are. Sorry for the wait. If you need anything else, let me know.
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: bigguy on August 15, 2006, 05:36:25 pm
Did you only get the error on the Index.template.php file. ??? I`ll try that one first.
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: Cholo on August 15, 2006, 07:56:32 pm
I believe so.  All I know right now is:

-My ads are up and working for the most part
-I can't display ads in the "login bar"(I think that's what it's called) as in other themes
-When I put ads under the menu bar, they go over to the left, even with <center> tags.
-I have a google image only ad that is set to display on the bottom of all pages. It displays on the bottom of every page except the home page.  ???
 
Other than those problems, everything else having to do with the ads seems to be working just fine.
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: bigguy on August 15, 2006, 10:53:10 pm
Do you have a link to the forum so I can see. ???
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: Cholo on August 15, 2006, 10:55:30 pm
  Oh yes, here you go... www.tarheelforum.com
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: bigguy on August 15, 2006, 11:32:14 pm
If you look here:

http://www.easyc.info/forum/index.php

That is were I had to put the edits so I could get it to show up even close to the "Login bar". To center the ads try this code:

Code: [Select]
<div align="center">ADCODE</div>
As for why they show on all pages at the bottom other than the index, I`m not sure maybe Jerm can answer that.
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: Cholo on August 15, 2006, 11:51:09 pm
 Thanks bigguy. I'm not expecting you have the answer to every one of my questions, but I figured I'd ask. I'll ask Jerm about the no show ad on the bottom. I'll try a few things more too.  And sorry for all the dumb questions, but where exactly would I put that alignment code? Thanks for all your help.
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: bigguy on August 16, 2006, 12:19:19 am
Put that code around the google ad code that you placed in the ad management mod. That should do it.
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: Cholo on August 16, 2006, 02:54:25 pm
 Thanks! That did it.  :)  And where should I post that question for Jerm? or should I pm him directly?
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: bigguy on August 16, 2006, 03:27:06 pm
No post somewhere on the forums here. maybe here:

http://www.smfads.com/forums/index.php?board=1.0
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: hygron on August 21, 2006, 03:29:55 am
Hey bigguy, I was reffered to you from a member at tinyportal, because I fot a failure message for index.template.php (the rest were successful) after attempting to apply ad manager to my smf1.0.7/tiny portal/techhead theme

I realize the edits you listed were for 1.1...so, can you help me?  Or, please refer me to the correct edits for 1.0.7/tp/techhead?  thanks, Hygron
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: bigguy on August 21, 2006, 10:02:24 am
I posted an answer to your other post, I think that answers this to.
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: skelm on August 26, 2006, 10:46:37 am
I am using pn-pn theme and get Template Parse Error! when i do the first edit on index.template.php, I tried doing all the edits. Same failure - then I tied doing just the first edit and it give me the below errors.


Template Parse Error!
There was a problem loading the /Themes/pnpn11rc3/index.template.php template or language file. Please check the syntax and try again - remember, single quotes (') often have to be escaped with a slash (\). To see more specific error information from PHP, try accessing the file directly.

You may want to try to refresh this page or use the default theme.

Parse error: parse error, unexpected T_STRING, expecting ',' or ';' in .../Themes/pnpn11rc3/index.template.php on line 209

200:
201:          current_header = mode;
202:       }
203:    // ]]></script>
204: </head>
205: <body>
206: //Display ads on the top of the page
207:    $ads = show_topofpageAds();   
208:    if(!empty($ads))

209:       if($ads['type']==0)

210:          echo $ads['content'];
211:       else
212:          eval($ads['content']);   
213:    unset($ads);
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: DawnsWebDesigns on August 28, 2006, 06:48:35 pm
I've looked & looked & looked for the right </td> to put your coding before or after.  I simply can't find it.  Actually I've round a few/don't know which to choose from.  I also tried downloading the one you fixed for someone else to copy what you did there.  I can't find a </td> with anything next to it to copy.  My text editing program has line numbers.  Can you tell me which one this </td> might be found?

I just got RC3.  The arcade & donations mods are so touchy you must install them first.  But now I can't install this ad mod through the package manager.  I tried to do it manually...& got an error code about the code missing a (') or a (;) or something like that.  But I already told you about it on the SMF board.  It totally crashed my board & I simply started over/built another one.  I won't do it again.

Maybe I'll just wait 'til I find one I can upload through the package manager.  :-\ 
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: bigguy on August 28, 2006, 07:11:10 pm
Do you have this code in the Index.template.php file ??? If so add the next edit after it:

Code: [Select]
</form>';
}

echo '
';
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: skelm on August 29, 2006, 02:54:34 pm
I am using pn-pn theme and get Template Parse Error! when i do the first edit on index.template.php, I tried doing all the edits. Same failure - then I tied doing just the first edit and it give me the below errors.


Template Parse Error!
There was a problem loading the /Themes/pnpn11rc3/index.template.php template or language file. Please check the syntax and try again - remember, single quotes (') often have to be escaped with a slash (\). To see more specific error information from PHP, try accessing the file directly.

You may want to try to refresh this page or use the default theme.

Parse error: parse error, unexpected T_STRING, expecting ',' or ';' in .../Themes/pnpn11rc3/index.template.php on line 209

200:
201:          current_header = mode;
202:       }
203:    // ]]></script>
204: </head>
205: <body>
206: //Display ads on the top of the page
207:    $ads = show_topofpageAds();   
208:    if(!empty($ads))

209:       if($ads['type']==0)

210:          echo $ads['content'];
211:       else
212:          eval($ads['content']);   
213:    unset($ads);


Bump - any help?

Thanks
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: bigguy on August 29, 2006, 03:37:11 pm
@ skelm: Completely sorry about that. Try this out, Remember to rename it:
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: skelm on August 30, 2006, 05:29:35 pm
That works perfectly!

Thanks - if your up to it here are the other 2 :)

Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: bigguy on August 31, 2006, 09:10:46 am
I'll see if I can get to them in a bit for you.
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: skelm on August 31, 2006, 09:44:55 am
thanks!
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: bigguy on August 31, 2006, 09:53:17 pm
Ok, try these:   ;)
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: skelm on September 01, 2006, 06:03:09 am
Ok, try these:   ;)
It looks like MessageIndex.template.php worked but displaytemplate gave a parse error.

Thanks

Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: bigguy on September 01, 2006, 10:54:51 am
Display.template.php, I'll give it a look in a bit.
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: S1L1C0N on September 01, 2006, 12:36:58 pm
I too am waiting for the manual edits needed for RC3, it would be awesome!  Using Epsilon theme.
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: bigguy on September 01, 2006, 01:55:52 pm
The edits for RC2 will work with RC3.
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: willi1 on September 03, 2006, 07:33:27 am
Hello i have a problem :'( ,

when i have modified my display.template.php then i become a template parse error
i use the classic theme when i switch to the default theme than all is ok.
I use teh version 1.1RC3 an the mod too

have you any suggestions for me?

thank you and best regards

willi1
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: bigguy on September 03, 2006, 02:28:21 pm
What type of editor are you using to put the edits in. ???
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: coiso on September 05, 2006, 06:11:25 pm
@ skelm: Completely sorry about that. Try this out, Remember to rename it:

Hi,
Sorry but i get the same error:

Code: [Select]
Template Parse Error!
There was a problem loading the /Themes/theme/index.template.php template or language file. Please check the syntax and try again - remember, single quotes (') often have to be escaped with a slash (\). To see more specific error information from PHP, try accessing the file directly.

You may want to try to refresh this page or use the default theme.
--------------------------------------------------------------------------------


Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in .../Themes/theme/index.template.php on line 307

298: <table id="upshrinkHeader2"', empty($options['collapse_header']) ? '' : ' style="display: none;"', ' width="100%" cellpadding="4" cellspacing="0" border="0">
299: <tr>';
300:
301:
302: echo '
303: <td width="90%" class="column-title">
304: //Below the menu ads
305: $ads = show_indexAds();
306: if(!empty($ads))
307: if($ads['type']==0)308: echo $ads['content'];
309: else
310: eval($ads['content']);

The theme is m3talc0re
And the original code is:

Code: [Select]
<?php
// Version: 1.1 RC3; index

/* This template is, perhaps, the most important template in the theme. It
contains the main template layer that displays the header and footer of
the forum, namely with main_above and main_below. It also contains the
menu sub template, which appropriately displays the menu; the init sub
template, which is there to set the theme up; (init can be missing.) and
the linktree sub template, which sorts out the link tree.

The init sub template should load any data and set any hardcoded options.

The main_above sub template is what is shown above the main content, and
should contain anything that should be shown up there.

The main_below sub template, conversely, is shown after the main content.
It should probably contain the copyright statement and some other things.

The linktree sub template should display the link tree, using the data
in the $context['linktree'] variable.

The menu sub template should display all the relevant buttons the user
wants and or needs.

For more information on the templating system, please see the site at:
http://www.simplemachines.org/
*/

// Initialize the template... mainly little settings.
function template_init()
{
global $context$settings$options$txt;

/* Use images from default theme when using templates from the default theme?
if this is 'always', images from the default theme will be used.
if this is 'defaults', images from the default theme will only be used with default templates.
if this is 'never' or isn't set at all, images from the default theme will not be used. */
$settings['use_default_images'] = 'never';

/* What document type definition is being used? (for font size and other issues.)
'xhtml' for an XHTML 1.0 document type definition.
'html' for an HTML 4.01 document type definition. */
$settings['doctype'] = 'xhtml';

/* The version this template/theme is for.
This should probably be the version of SMF it was created for. */
$settings['theme_version'] = '1.1 RC3';

/* Set a setting that tells the theme that it can render the tabs. */
$settings['use_tabs'] = true;

/* Use plain buttons - as oppossed to text buttons? */
$settings['use_buttons'] = true;

/* Show sticky and lock status seperate from topic icons? */
$settings['seperate_sticky_lock'] = true;
}

// The main sub template above the content.
function template_main_above()
{
global $context$settings$options$scripturl$txt$modSettings;

// Show right to left and the character set for ease of translating.
echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"'
$context['right_to_left'] ? ' dir="rtl"' '''><head>
<meta http-equiv="Content-Type" content="text/html; charset='
$context['character_set'], '" />
<meta name="description" content="'
$context['page_title'], '" />
<meta name="keywords" content="Game forum, cheats, hints, hacks, sony psp, nintendo, gamecube, xbox 360, wii, gamecube advanced, Playstation, MMORPG, arcade games, pc games, online games" />
<script language="JavaScript" type="text/javascript" src="'
$settings['default_theme_url'], '/script.js?rc3"></script>
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
var smf_theme_url = "'
$settings['theme_url'], '";
var smf_images_url = "'
$settings['images_url'], '";
var smf_scripturl = "'
$scripturl'";
// ]]></script>
<title>'
$context['page_title'], '</title>';

// The ?rc3 part of this link is just here to make sure browsers don't cache it wrongly.
echo '
<link rel="stylesheet" type="text/css" href="'
$settings['theme_url'], '/style.css?rc3" />
<link rel="stylesheet" type="text/css" href="'
$settings['default_theme_url'], '/print.css?rc3" media="print" />';

/* Internet Explorer 4/5 and Opera 6 just don't do font sizes properly. (they are big...)
Thus, in Internet Explorer 4, 5, and Opera 6 this will show fonts one size smaller than usual.
Note that this is affected by whether IE 6 is in standards compliance mode.. if not, it will also be big.
Standards compliance mode happens when you use xhtml... */
if ($context['browser']['needs_size_fix'])
echo '
<link rel="stylesheet" type="text/css" href="'
$settings['default_theme_url'], '/fonts-compat.css" />';

// Show all the relative links, such as help, search, contents, and the like.
echo '
<link rel="help" href="'
$scripturl'?action=help" target="_blank" />
<link rel="search" href="' 
$scripturl '?action=search" />
<link rel="contents" href="'
$scripturl'" />';

// If RSS feeds are enabled, advertise the presence of one.
if (!empty($modSettings['xmlnews_enable']))
echo '
<link rel="alternate" type="application/rss+xml" title="'
$context['forum_name'], ' - RSS" href="'$scripturl'?type=rss;action=.xml" />';

// If we're viewing a topic, these should be the previous and next topics, respectively.
if (!empty($context['current_topic']))
echo '
<link rel="prev" href="'
$scripturl'?topic='$context['current_topic'], '.0;prev_next=prev" />
<link rel="next" href="'
$scripturl'?topic='$context['current_topic'], '.0;prev_next=next" />';

// If we're in a board, or a topic for that matter, the index will be the board's index.
if (!empty($context['current_board']))
echo '
<link rel="index" href="' 
$scripturl '?board=' $context['current_board'] . '.0" />';

// We'll have to use the cookie to remember the header...
if ($context['user']['is_guest'])
$options['collapse_header'] = !empty($_COOKIE['upshrink']);

// Output any remaining HTML headers. (from mods, maybe?)
echo $context['html_headers'], '

<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
var current_header = '
, empty($options['collapse_header']) ? 'false' 'true'';

function shrinkHeader(mode)
{'
;

// Guests don't have theme options!!
if ($context['user']['is_guest'])
echo '
document.cookie = "upshrink=" + (mode ? 1 : 0);'
;
else
echo '
smf_setThemeOption("collapse_header", mode ? 1 : 0, null, "'
$context['session_id'], '");';

echo '
document.getElementById("upshrink").src = smf_images_url + (mode ? "/upshrink2.gif" : "/upshrink.gif");

document.getElementById("upshrinkHeader").style.display = mode ? "none" : "";
document.getElementById("upshrinkHeader2").style.display = mode ? "none" : "";

current_header = mode;
}
// ]]></script>'
;

// the routine for the info center upshrink
echo '
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
var current_header_ic = '
, empty($options['collapse_header_ic']) ? 'false' 'true'';

function shrinkHeaderIC(mode)
{'
;

if ($context['user']['is_guest'])
echo '
document.cookie = "upshrinkIC=" + (mode ? 1 : 0);'
;
else
echo '
smf_setThemeOption("collapse_header_ic", mode ? 1 : 0, null, "'
$context['session_id'], '");';

echo '
document.getElementById("upshrink_ic").src = smf_images_url + (mode ? "/expand.gif" : "/collapse.gif");

document.getElementById("upshrinkHeaderIC").style.display = mode ? "none" : "";

current_header_ic = mode;
}
// ]]></script>
</head>
<body>'
;

echo '
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td id="top-logo"><img src="'
$settings['images_url'], '/logo.jpg" width="358" height="91" alt="SlickPro Graphite" title="SlickPro Graphite" /></td>
</tr>
<tr>
<td width="100%" align="left" valign="top" style="padding:0 30px 0 30px;">'
;

echo '
<div class="tborder" '
$context['browser']['needs_size_fix'] && !$context['browser']['is_ie6'] ? ' style="width: 100%;"' '''>';


// display user name
echo '
<table width="100%" cellspacing="1" cellpadding="5" class="bordercolor" border="0" >
<tr>'
;

echo '
<td class="windowbg2" width="100%" valign="middle" align="left">'
theme_newestlink(), '<br />
'
theme_linktree2(), '
</td>'
;

echo '
<td width="250" valign="top" class="windowbg"><span class="middletext" style="display:block;width:250px;">'
;

if($context['user']['is_logged'])
{
echo '
<strong>Welcome, '
$context['user']['name'] , '.</strong><br />';
}

// Go to PM center... [pm]
if ($context['user']['is_logged'] && $context['allow_pm'])
{
echo ((isset($current_action) && $curent_action == 'pm') || $context['browser']['is_ie4']) ? '' '' '
<a href="'
$scripturl'?action=pm">Private Messages</a>: '$context['user']['unread_messages'], ' Unread, '$context['user']['messages'], ' Total.<br />';
}

// Now, onto our second set of info, are they logged in again?
if ($context['user']['is_logged'])
{
// Is the forum in maintenance mode?
if ($context['in_maintenance'] && $context['user']['is_admin'])
echo '
<b>'
$txt[616], '</b><br />';

// Are there any members waiting for approval?
if (!empty($context['unapproved_members']))
echo '
'
$context['unapproved_members'] == $txt['approve_thereis'] : $txt['approve_thereare'], ' <a href="'$scripturl'?action=viewmembers;sa=browse;type=approve">'$context['unapproved_members'] == $txt['approve_member'] : $context['unapproved_members'] . ' ' $txt['approve_members'], '</a> '$txt['approve_members_waiting'], '<br />';

// Show the total time logged in?
if (!empty($context['user']['total_time_logged_in']))
{
echo '
'
$txt['totalTimeLogged1'], '<br />';

// If days is just zero, don't bother to show it.
if ($context['user']['total_time_logged_in']['days'] > 0)
echo $context['user']['total_time_logged_in']['days'] . $txt['totalTimeLogged2'];

// Same with hours - only show it if it's above zero.
if ($context['user']['total_time_logged_in']['hours'] > 0)
echo $context['user']['total_time_logged_in']['hours'] . $txt['totalTimeLogged3'];

// But, let's always show minutes - Time wasted here: 0 minutes ;).
echo $context['user']['total_time_logged_in']['minutes'], $txt['totalTimeLogged4'], '<br />';
}
}
// Otherwise they're a guest - this time ask them to either register or login - lazy bums...
else
{
echo ' </span>
<script language="JavaScript" type="text/javascript" src="'
$settings['default_theme_url'], '/sha1.js"></script>

<form action="'
$scripturl'?action=login2" method="post" accept-charset="'$context['character_set'], '" class="middletext" style="margin: 3px 1ex 1px 0;"', empty($context['disable_login_hashing']) ? ' onsubmit="hashLoginPassword(this, \'' $context['session_id'] . '\');"' '''>
<table border="0" cellpadding="1" cellspacing="0">
<tr>
<td>Username:</td>
<td><input type="text" name="user" size="10" /></td>
<td><select name="cookielength">
<option value="60">'
$txt['smf53'], '</option>
<option value="1440">'
$txt['smf47'], '</option>
<option value="10080">'
$txt['smf48'], '</option>
<option value="43200">'
$txt['smf49'], '</option>
<option value="-1" selected="selected">'
$txt['smf50'], '</option>
</select></td>
</tr>
<tr>
<td>Password:</td>
<td><input type="password" name="passwrd" size="10" /></td>
<td><input type="submit" value="'
$txt[34], '" /></td>
</tr>
</table>
<input type="hidden" name="hash_passwrd" value="" />
</form>'
;
}

echo '
</span>
</td>
</tr>
</table>'
;

echo '
<table id="upshrinkHeader2"'
, empty($options['collapse_header']) ? '' ' style="display: none;"'' width="100%" cellpadding="4" cellspacing="0" border="0">
<tr>'
;


echo '
<td width="90%" class="column-title">
'
template_menu(), '
</td>'
;
echo '
<td class="column-title" align="right" nowrap="nowrap" valign="top">
<form action="'
$scripturl'?action=search2" method="post" accept-charset="'$context['character_set'], '" style="margin: 0;">
<a href="'
$scripturl'?action=search;advanced"><img src="'.$settings['images_url'].'/filter.gif" align="middle" style="margin: 0 1ex;" alt="" /></a>
<input type="text" name="search" value="" style="width: 190px;" />&nbsp;
<input type="submit" name="submit" value="'
$txt[182], '" style="width: 11ex;" />
<input type="hidden" name="advanced" value="0" />'
;

// Search within current topic?
if (!empty($context['current_topic']))
echo '
<input type="hidden" name="topic" value="'
$context['current_topic'], '" />';

// If we're on a certain board, limit it to this board ;).
elseif (!empty($context['current_board']))
echo '
<input type="hidden" name="brd['
$context['current_board'], ']" value="'$context['current_board'], '" />';

echo '
</form>
</td>
</tr>
</table>
</div>'
;


// The main content should go here.
echo '
<div id="bodyarea">'
;

// If you want to put some ads or something on your pages, add them in this.
echo '
<div id="blank-box"></div>'
;
}

function 
template_main_below()
{
global $context$settings$options$scripturl$txt;

echo '
</div>'
;

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

<div id="footerarea" style="text-align: center; padding-bottom: 1ex;'
$context['browser']['needs_size_fix'] && !$context['browser']['is_ie6'] ? ' width: 100%;' '''">
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
function smfFooterHighlight(element, value)
{
element.src = smf_images_url + "/" + (value ? "h_" : "") + element.id + ".gif";
}
// ]]></script>
<table cellspacing="0" cellpadding="3" border="0" align="center" width="100%">
<tr>
<td width="28%" valign="middle" align="left" class="copyright-links">
Theme by <a href="http://www.m3talc0re.com/" target="_blank" style="font-size:10px;">m3talc0re</a>.
</td>
<td valign="middle" align="center" style="white-space: nowrap;" class="copyright-links">
'
theme_copyright(), '
</td>
<td width="28%" valign="middle" align="right" class="copyright-links">
<a href="http://www.mysql.com/" target="_blank" style="font-size:10px;">MySQL</a>&nbsp;|&nbsp;<a href="http://www.php.net/" target="_blank" style="font-size:10px;">PHP</a>&nbsp;|&nbsp;<a href="http://validator.w3.org/check/referer" target="_blank" style="font-size:10px;">XHTML</a>&nbsp;|&nbsp;<a href="http://jigsaw.w3.org/css-validator/check/referer" target="_blank" style="font-size:10px;">CSS</a>
</td>
</tr>
</table>'
;

// Show the load time?
if ($context['show_load_time'])
echo '
<span class="smalltext">'
$txt['smf301'], $context['load_time'], $txt['smf302'], $context['load_queries'], $txt['smf302b'], '</span>';

// This is an interesting bug in Internet Explorer AND Safari. Rather annoying, it makes overflows just not tall enough.
if (($context['browser']['is_ie'] && !$context['browser']['is_ie4']) || $context['browser']['is_mac_ie'] || $context['browser']['is_safari'])
{
// The purpose of this code is to fix the height of overflow: auto div blocks, because IE can't figure it out for itself.
echo '
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA['
;

// Unfortunately, Safari does not have a "getComputedStyle" implementation yet, so we have to just do it to code...
if ($context['browser']['is_safari'])
echo '
window.addEventListener("load", smf_codeFix, false);

function smf_codeFix()
{
var codeFix = document.getElementsByTagName ? document.getElementsByTagName("div") : document.all.tags("div");

for (var i = 0; i < codeFix.length; i++)
{
if ((codeFix[i].className == "code" || codeFix[i].className == "post" || codeFix[i].className == "signature") && codeFix[i].offsetHeight < 20)
codeFix[i].style.height = (codeFix[i].offsetHeight + 20) + "px";
}
}'
;
else
echo '
var window_oldOnload = window.onload;
window.onload = smf_codeFix;

function smf_codeFix()
{
var codeFix = document.getElementsByTagName ? document.getElementsByTagName("div") : document.all.tags("div");

for (var i = codeFix.length - 1; i > 0; i--)
{
if (codeFix[i].currentStyle.overflow == "auto" && (codeFix[i].currentStyle.height == "" || codeFix[i].currentStyle.height == "auto") && (codeFix[i].scrollWidth > codeFix[i].clientWidth || codeFix[i].clientWidth == 0) && (codeFix[i].offsetHeight != 0 || codeFix[i].className == "code"))
codeFix[i].style.height = (codeFix[i].offsetHeight + 36) + "px";
}

if (window_oldOnload)
{
window_oldOnload();
window_oldOnload = null;
}
}'
;

echo '
// ]]></script>'
;
}

echo '
</div></td></tr></table>'
;

// The following will be used to let the user know that some AJAX process is running
echo '
<div id="ajax_in_progress" style="display: none;'
$context['browser']['is_ie'] && !$context['browser']['is_ie7'] ? 'position: absolute;' '''">'$txt['ajax_in_progress'], '</div>
</body></html>'
;
}

// If the user is logged in, display stuff like their  new messages, etc...
function theme_newestlink()
{
global $context$settings$options$scripturl$txt;

if ($context['user']['is_logged'])
{
echo '
<a href="'
$scripturl'?action=unread">'$txt['unread_since_visit'], '</a>&nbsp;|&nbsp;<a href="'$scripturl'?action=unreadreplies">'$txt['show_unread_replies'], '</a>';

}
// Otherwise they're a guest - send them a lovely greating...
else
echo $txt['welcome_guest'];
}

function 
theme_linktree()
{
global $context$settings$options;

// Folder style or inline?  Inline has a smaller font.
echo '<br />';

}

function 
theme_linktree2()
{
global $context$settings$options;

// Folder style or inline?  Inline has a smaller font.
echo '<span class="nav-tree" style="font-size: smaller;">';

// Each tree item has a URL and name.  Some may have extra_before and extra_after.
foreach ($context['linktree'] as $link_num => $tree)
{
// Show pretty folder
if ($link_num == 0)
{
echo '<img src="' $settings['images_url'] . '/icons/folder_open.gif" alt="+" border="0" />&nbsp; ';
}
else if ($link_num == 1)
{
echo '<img src="' $settings['images_url'] . '/icons/linktree_side.gif" alt="|-" border="0" /><img src="' $settings['images_url'] . '/icons/folder_open.gif" alt="+" border="0" />&nbsp; ';
}
else
{
echo '&raquo; ';
}

// Show the link, including a URL if it should have one.
echo '<b>'$settings['linktree_link'] && isset($tree['url']) ? '<a href="' $tree['url'] . '" class="nav-tree">' $tree['name'] . '</a>' $tree['name'], '</b>';

if ($link_num == 0)
{
echo '<br />';
}
}

echo '</span>';
}

// Show the menu up top. Something like [home] [help] [profile] [logout]...
function template_menu()
{
global $context$settings$options$scripturl$txt;

// Work out where we currently are.
$current_action 'home';
if (in_array($context['current_action'], array('admin''ban''boardrecount''cleanperms''detailedversion''dumpdb''featuresettings''featuresettings2''findmember''maintain''manageattachments''manageboards''managecalendar''managesearch''membergroups''modlog''news''optimizetables''packageget''packages''permissions''pgdownload''postsettings''regcenter''repairboards''reports''serversettings''serversettings2''smileys''viewErrorLog''viewmembers')))
$current_action 'admin';
if (in_array($context['current_action'], array('search''admin''calendar''profile''mlist''register''login''help''pm')))
$current_action $context['current_action'];
if ($context['current_action'] == 'search2')
$current_action 'search';
if ($context['current_action'] == 'theme')
$current_action = isset($_REQUEST['sa']) && $_REQUEST['sa'] == 'pick' 'profile' 'admin';

// Are we using right-to-left orientation?
if ($context['right_to_left'])
{
$first 'last';
$last 'first';
}
else
{
$first 'first';
$last 'last';
}

// Show the start of the tab section.
echo '
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>'
;

// Show the [home] button.
echo '
<td class="main-navigation"><a href="'
$scripturl'">' $txt[103] , '</a></td>';

// Show the [help] button.
echo '
<td class="main-navigation"><a href="'
$scripturl'?action=help">' $txt[119] , '</a></td>';

// How about the [search] button?
if ($context['allow_search'])
echo '
<td class="main-navigation"><a href="'
$scripturl'?action=search">' $txt[182] , '</a></td>';

// Is the user allowed to administrate at all? ([admin])
if ($context['allow_admin'])
echo '
<td class="main-navigation"><a href="'
$scripturl'?action=admin">' $txt[2] , '</a></td>';

// Edit Profile... [profile]
if ($context['allow_edit_profile'])
echo '
<td class="main-navigation"><a href="'
$scripturl'?action=profile">' $txt[79] , '</a></td>';

// The [calendar]!
if ($context['allow_calendar'])
echo '
<td class="main-navigation"><a href="'
$scripturl'?action=calendar">' $txt['calendar24'] , '</a></td>';

// the [member] list button
if ($context['allow_memberlist'])
echo '
<td class="main-navigation"><a href="'
$scripturl'?action=mlist">' $txt[331] , '</a></td>';


// If the user is a guest, show [login] button.
if ($context['user']['is_guest'])
echo '
<td class="main-navigation"><a href="'
$scripturl'?action=login">' $txt[34] , '</a></td>';


// If the user is a guest, also show [register] button.
if ($context['user']['is_guest'])
echo '
<td class="main-navigation"><a href="'
$scripturl'?action=join">' $txt[97] , '</a></td>';


// Otherwise, they might want to [logout]...
if ($context['user']['is_logged'])
echo '
<td class="main-navigation"><a href="'
$scripturl'?action=logout;sesc='$context['session_id'], '">' $txt[108] , '</a></td>';

// The end of tab section.
echo '
</tr>
</table>'
;

}

// Generate a strip of buttons.
function template_button_strip($button_strip$direction 'top'$force_reset false$custom_td '')
{
global $settings$buttons$context$txt$scripturl;

// Create the buttons...
foreach ($button_strip as $key => $value)
{
if (isset($value['test']) && empty($context[$value['test']]))
{
unset($button_strip[$key]);
continue;
}
elseif (!isset($buttons[$key]) || $force_reset)
$buttons[$key] = '<a href="' $value['url'] . '" ' .( isset($value['custom']) ? $value['custom'] : '') . '>' $txt[$value['text']] . '</a>';

$button_strip[$key] = $buttons[$key];
}

if (empty($button_strip))
return '<td>&nbsp;</td>';

echo '
<td class="'
$direction == 'top' 'main' 'mirror''tab_' $context['right_to_left'] ? 'last' 'first' '">&nbsp;</td>
<td class="'
$direction == 'top' 'main' 'mirror''tab_back">'implode(' &nbsp;|&nbsp; '$button_strip) , '</td>
<td class="'
$direction == 'top' 'main' 'mirror''tab_' $context['right_to_left'] ? 'first' 'last' '">&nbsp;</td>';
}

?>
Any ideia?
Thank you
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: bigguy on September 05, 2006, 09:01:21 pm
Try this. If it works can you tell me what theme this is for ???
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: coiso on September 06, 2006, 07:44:00 am
Try this. If it works can you tell me what theme this is for ???
Hi,

Sorry!
The theme is SlickPro Graphite.

http://themes.simplemachines.org/index.php?lemma=116

Your file corrects the index forum. Now when i try to see a post i get this error.

Code: [Select]
Template Parse Error!
There was a problem loading the /Themes/theme/Display.template.php template or language file. Please check the syntax and try again - remember, single quotes (') often have to be escaped with a slash (\). To see more specific error information from PHP, try accessing the file directly.

You may want to try to refresh this page or use the default theme.
--------------------------------------------------------------------------------


Parse error: syntax error, unexpected $end in .../Themes/theme/Display.template.php on line 1420

1411: if ($context['show_spellchecking'])
1412:
1413: echo '
1414:
1415: <form action="', $scripturl, '?action=spellcheck" method="post" accept-charset="', $context['character_set'], '" name="spell_form" id="spell_form" target="spellWindow"><input type="hidden" name="spellstring" value="" /></form>';
1416:
1417: }
1418:
1419: }
1420: ?>1421:
1422:

Could you please give me a hand?
Thank you
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: bigguy on September 06, 2006, 10:22:49 am
Can you send me the rest of the template files for that theme that need to be edited. ???
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: coiso on September 06, 2006, 10:29:59 am
Can you send me the rest of the template files for that theme that need to be edited. ???
Here are the ones i edited!

Thank you
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: bigguy on September 06, 2006, 10:46:12 am
Try this Display.template.php file:
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: coiso on September 06, 2006, 10:50:47 am
Try this Display.template.php file:
Nop.
I got the same error:

Template Parse Error!
There was a problem loading the /Themes/theme/Display.template.php template or language file. Please check the syntax and try again - remember, single quotes (') often have to be escaped with a slash (\). To see more specific error information from PHP, try accessing the file directly.

You may want to try to refresh this page or use the default theme.
--------------------------------------------------------------------------------


Parse error: syntax error, unexpected $end in .../Themes/theme/Display.template.php on line 754

745:    </tr>
746: </table>';
747:
748:       if ($context['show_spellchecking'])
749:          echo '
750: <form action="', $scripturl, '?action=spellcheck" method="post" accept-charset="', $context['character_set'], '" name="spell_form" id="spell_form" target="spellWindow"><input type="hidden" name="spellstring" value="" /></form>';
751:    }
752: }
753:
754: ?>     <<<<---------------------------------------- error here?
755:
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: bigguy on September 06, 2006, 10:55:53 am
There shouldn't be a problem with that at all. hmmm, I'll have to look at it more closely. Do the ads work everywhere else ??? If they do you could always use the original Display.template.php for now while I try to work on this. It has to be something simple.
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: coiso on September 06, 2006, 11:01:13 am
Yep. In the index it works great!
Only doenst work when i try to see a post :(
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: bigguy on September 06, 2006, 11:02:38 am
Ok, replace the broken Display.template.php file with a clean one and see if your forum works. If it does use it that way for now and I will take a look at this later today if I have time.
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: coiso on September 06, 2006, 11:06:16 am
Yeah with the clean Display.template.php the forum works fine and it only display the ads in the index forum.

Thank you for your help
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: moonrock on September 11, 2006, 10:20:20 pm
Hi BigGuy,

I get this error on my index.template.php of Ancient and Rusted (http://themes.simplemachines.org/index.php?lemma=100) template

Quote
Template Parse Error!
There was a problem loading the /Themes/Ancient_and_Rusted/index.template.php template or language file. Please check the syntax and try again - remember, single quotes (') often have to be escaped with a slash (\).

every other modifications work fine except this one.
can you help ?

attached is the original index.template.php

i got the error in the very first change to this particular file.
maybe you can tell me why? cos i got the same error when modifying other template too!
i want to learn!

Code: [Select]
<file name="$themedir/index.template.php">
<operation>
<search position="before"><![CDATA[<body>';]]></search>

<add><![CDATA[
//Display ads on the top of the page
$ads = show_topofpageAds();
if(!empty($ads))
if($ads['type']==0)
echo $ads['content'];
else
eval($ads['content']);
unset($ads);
]]>
</add>
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: bigguy on September 12, 2006, 09:32:00 am
Are you using TP ??? If not don't upload this. If you are it should work fine.
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: coiso on September 15, 2006, 03:06:33 pm
Hi,

Sorry to bother but i still have this error:

Code: [Select]
Template Parse Error!
There was a problem loading the /Themes/theme/Display.template.php template or language file. Please check the syntax and try again - remember, single quotes (') often have to be escaped with a slash (\). To see more specific error information from PHP, try accessing the file directly.

You may want to try to refresh this page or use the default theme.
--------------------------------------------------------------------------------


Parse error: syntax error, unexpected $end in .../Themes/theme/Display.template.php on line 754

745:    </tr>
746: </table>';
747:
748:       if ($context['show_spellchecking'])
749:          echo '
750: <form action="', $scripturl, '?action=spellcheck" method="post" accept-charset="', $context['character_set'], '" name="spell_form" id="spell_form" target="spellWindow"><input type="hidden" name="spellstring" value="" /></form>';
751:    }
752: }
753:
[b]754: ?>     <<<<---------------------------------------- error here?[/b]
755:


Do you have any ideia why?

the theme is SlickPro Graphite.

http://themes.simplemachines.org/index.php?lemma=116

Thank you.
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: moonrock on September 16, 2006, 02:39:55 am
Are you using TP ??? If not don't upload this. If you are it should work fine.

no. i'm not using TP. can I still use it ?
if not, i can try to install TP
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: bigguy on September 18, 2006, 07:19:20 pm
No it should work for you. I was talking about that index.template.php file in my last post. The ad mod should work for you if you wish to install it.
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: bigguy on September 18, 2006, 07:20:18 pm
If you can get the template files to me, unedited I will try to add the ad code to it.

Hi,

Sorry to bother but i still have this error:

Code: [Select]
Template Parse Error!
There was a problem loading the /Themes/theme/Display.template.php template or language file. Please check the syntax and try again - remember, single quotes (') often have to be escaped with a slash (\). To see more specific error information from PHP, try accessing the file directly.

You may want to try to refresh this page or use the default theme.
--------------------------------------------------------------------------------


Parse error: syntax error, unexpected $end in .../Themes/theme/Display.template.php on line 754

745:    </tr>
746: </table>';
747:
748:       if ($context['show_spellchecking'])
749:          echo '
750: <form action="', $scripturl, '?action=spellcheck" method="post" accept-charset="', $context['character_set'], '" name="spell_form" id="spell_form" target="spellWindow"><input type="hidden" name="spellstring" value="" /></form>';
751:    }
752: }
753:
[b]754: ?>     <<<<---------------------------------------- error here?[/b]
755:


Do you have any ideia why?

the theme is SlickPro Graphite.

http://themes.simplemachines.org/index.php?lemma=116

Thank you.
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: coiso on September 19, 2006, 03:02:04 pm
If you can get the template files to me, unedited I will try to add the ad code to it.

Hi,
Sure!
Files are attached!

Thank you very much!
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: bigguy on September 19, 2006, 04:32:34 pm
Ok try these and see if they work. Zip file attached.
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: coiso on September 19, 2006, 05:03:05 pm
Ok try these and see if they work. Zip file attached.
Im a big pain in the *** lol

No errors. Display.template.php Works in all positions except the the most important: Display ads within posts
lol  :(

Im using PHP5 not sure if it makes any diference...

Thank you
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: bigguy on September 19, 2006, 05:11:34 pm
There should be no problem with any of it. Do you have scripts blocked in FF (if your using it) have you cleaned out your temp files and tried a hard refresh. ??? Do the slots for the ads show up in between posts or not. ???
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: ravenlife on September 30, 2006, 04:39:41 am
Hello,

i too have teh parse error.

i could only find the lines in the DISPLAY.TEMPLATE.PHP and MessageIndex.template.php files. i couldnt find the other lines in the other files

i have the forum wrapped with joomla, but even the standalone doesnt display the ads.

any help with this would be appreciated.

Thanks

RavenLife

Things i have -
SMF RC2 (patched to 2-2)
SMF bridge From JoomlaHacks
Joomla 1.0.11
Versatility2 theme from Rockettheme.com

(http://img100.imageshack.us/img100/4868/parseerrorfy5.th.jpg)[/] (http://img100.imageshack.us/my.php?image=parseerrorfy5.jpg)
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: flits on October 02, 2006, 08:22:13 am
Your followed the intruction exactly as posted, which is good! But this time you should not have done that ;) ;D

This was mentioned in the instructions:
In the same file FIND:
Code: [Select]
// Get all the messages...
And REPLACE with:

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

What you did was overwriting only the "// Get all the messages..." line with the new content ;)
I made the same mistake and ended up with the same error! (maybe the instructions should be changed ;))

This is what the instruction should say:
In the same file FIND:
Code: [Select]
// Get all the messages...
while ($message = $context['get_message']())
{

And replace it with:
Code: [Select]
//Ad Counter
$adcounter =0;
// Get all the messages...
while ($message = $context['get_message']())
{
$adcounter++;




Hope this helped ;)
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: DoA on October 02, 2006, 04:37:10 pm
hi bigguy,

firstly many thanks for taking the time to figure this out, its because of people like you that the software and additional themes keep running.


Having said that, I can't get it to work - I got an index.template.php parse error when i'd done the first edits, I replaced that and got subsequent edits on other pages - so at the moment i'm back to the old unmodified template.

I would really apprechiate it if you could help me get this sorted out - i'm using the helios multi template by bloc --> http://www.tinyportal.net/smf/index.php?action=tpmod;dl=cat27


Many thanks in advance.


I'm on msn messenger and email, but easiest way to contact me is PM. I'll keep an eye on this thread.


Adam
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: bigguy on October 02, 2006, 06:23:06 pm
Can you post the index.template.php file for me and I will take alook.
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: ravenlife on October 03, 2006, 04:02:54 am
flitz i did what you said and i no longer get the parse error

altough i still do not see any adverts.

any help would be appreciated

RL
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: DoA on October 03, 2006, 09:06:38 am
Hi bigguy,

Thanks for the reply - i'll post if this doesn't sort it out


I am running forum version 1.07 - do I have to use these instructions - http://www.smfads.com/forums/index.php?topic=59.0    ????

Do the mods in the post linked above work for all templates or just the default one?
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: bigguy on October 04, 2006, 09:45:43 am
Yes those are the edits to use and yes they SHOULD work with all themes. Some people name things differently in themes so it might be hard to find some of the edits but it does work.
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: Vinspire on October 04, 2006, 01:11:35 pm
Hi, is it possible to make a tutorial on how to edit ad_mod for RC3 in Helios Eclipse Theme.

The codes in those theme seems to be quite different from other theme ...

Link to download the theme : http://www.tinyportal.net/smf/index.php?action=tpmod;dl=item406
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: bigguy on October 04, 2006, 03:06:55 pm
lol, I thought you mean helios multi just for SMF over on simplemachines.org so I went ahead and did the edits for that theme. I have not tried editing a theme that involves Tp yet.
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: bigguy on October 04, 2006, 03:25:42 pm
Ok, try this, this is only for helios mutli for TP:
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: Vinspire on October 04, 2006, 10:27:30 pm
lol, I thought you mean helios multi just for SMF over on simplemachines.org so I went ahead and did the edits for that theme. I have not tried editing a theme that involves Tp yet.

Lolz ... luckily i've posted a link for it.  :D

Ok, try this, this is only for helios mutli for TP:

Thanks a lot bigguy. Will check it out  8)
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: Duernu on October 06, 2006, 07:03:53 am
Hello!

I have a big problem, everythig is installed OK but I can`t see any ads.
If I turn to "default theme" it wors ok so I think it is because of the theme I`m using ("puzzle" theme).
I use SMF 1.1 RC3 forum version, and I have tried to do the index.template modifications but then I had a "farse error" and the forum did not work at all.
Any idea of how can I change that file?

Thank you
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: bigguy on October 06, 2006, 02:19:37 pm
@ Duernu: try this it should work.
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: Duernu on October 07, 2006, 04:43:03 am
it works! Thanks a lot bigguy ;D ;D ;D
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: Vinspire on October 07, 2006, 01:10:00 pm
Ok, try this, this is only for helios mutli for TP:

bigguy, thx for the files. i manage to get it working but it look super weird in helios theme wif the codes you send to me.

i'll have to re-allocate the ads location again but ur file does make a good guideline on which files i need to edit. thanks buddy :)
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: Vinspire on October 07, 2006, 02:37:04 pm
bigguy, from the codes you gave me ... this is how the welcome ads appear in my helios theme.

(http://img179.imageshack.us/img179/5649/ad1ks3.png)

So, i've tried my best to change the welcome ads but the best i could do is

(http://img156.imageshack.us/img156/6328/ad2dx2.png)

Any idea of how to get the welcome ads to be in the position it is suppose to be like in the default ?

(http://img143.imageshack.us/img143/3205/ads3ud5.png)
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: bigguy on October 07, 2006, 07:09:25 pm
The first 2 do look wierd but the third looks like it's in place. Helios multi is a hard one to get right. If you don't get it I will try again. Glad it works though with no errors.
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: Vinspire on October 08, 2006, 12:20:12 am
The first 2 do look wierd but the third looks like it's in place. Helios multi is a hard one to get right. If you don't get it I will try again. Glad it works though with no errors.

Yeap. Helios is a hard one  :-[

Help me get the welcome ads to be like the 3rd one please ... Been spending few hours trying to get it in the position. I think it needed extra code  :( >:(

Thanks :)
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: crazypal24x7 on October 08, 2006, 02:38:43 am
heeyaaaaa !!!!!

well I m lil confused  coz I dont hav display.template.php in my dilbermc theme folder !!
plz can any1 help me !!!!!!! but I hav dat file in mah default theme folder, do I hav 2 edit dat file 4 ad management 2 work on my dilber Mc theme  ????

adios !!!!!!!
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: bigguy on October 09, 2006, 01:07:44 pm
crazypal24x7 if there is no display.template.php then SMF uses the default template file and ti should already be edited through the installation of the ad mod, unless you had erros on that file in particular when installing.
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: bigguy on October 09, 2006, 01:08:52 pm
Vinspire I will try to do the edits again and see what I can come up with. Another idea would be to ask the author of the theme. Show him the files I edited and see what he can come up with.
Title: Re: Edits for the default theme
Post by: ronnyship on October 15, 2006, 05:04:17 am
Make sure the mod is installed first and then edit the template you want to use with these edits.

I am having problems in getting my mod installed (just got your tip in other thread to do it manually). Have tried that but no sucess so far. Tech info: [ad_mod_1-0-8_v1-0-2c.zip on SMF 1.0.8. Theme: Arobase Skin. When installing the mod, I get following messages (in Norwegian but assume understandable):

1. Kjr kode install.php 
2. Kjr modifikasjon ./Sources/ModSettings.php Mislyktes (failed)
3. Kjr modifikasjon ./Themes/default/languages/Modifications.english.php Sucess
4. Kjr modifikasjon ./Themes/default/index.template.php Sucess
5. Kjr modifikasjon ./Themes/default/BoardIndex.template.php Sucess
6. Kjr modifikasjon ./Themes/default/Display.template.php Sucess
7. Kjr modifikasjon ./Themes/default/MessageIndex.template.php Sucess
8. Kjr modifikasjon ./Sources/ManagePermissions.php Sucess

For some reason I am not able to change permissions on the "ModSettings.php" file to 777. Is that what is failing my MOD to install? I cannot locate any topic on how to fix this although I am sure you guys have answered similar question before. Really really like this MOD so am not giving up  ;)

Any obvious error or operation I can do to get this working with my theme?
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: chinclub on October 19, 2006, 02:44:18 pm
I am in need of a little help.  I'm not sure if you can help me on this thread or if you can point me to the correct spot to look.  I am needing to do a manual install on RC3 on the default theme.  Apparently some of my other mods are interfering with the package install for Display.template.php & index.template.php.

I followed the directions in the begining of this thread and all went well until I went to post a new thread to my board.  That gave me a template Parse Error for Display.template.php.

Line 840 was highlighted which is the last line of Display.template.php with only this:

?>

I redid the code twice to be sure it wasn't a typo on my part.  Any suggestions, please...    :-\
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: bigguy on October 19, 2006, 02:49:57 pm
@ ronnyship: I would asume that is the problem. Ask your host if they can change the permissions on that file for you and possibly check to re-own your files.

@ chinclub: Can you post that file for me and I will see if I can do it for you. ???
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: chinclub on October 19, 2006, 02:59:34 pm
That is so nice of you!  Thank-you! Here is the Display.template.php without the manual install.
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: bigguy on October 19, 2006, 03:04:13 pm
Ok try this one:
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: chinclub on October 19, 2006, 03:30:24 pm
I still get the same error


There was a problem loading the /Themes/default/Display.template.php

840: ?>
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: bigguy on October 19, 2006, 04:06:53 pm
There should not have been any problem with that at all. Hmm, I will try again.
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: mutya on October 19, 2006, 08:47:36 pm
hello!
The ad mod v2 is now working in my default theme. I'm now trying to make it work for the dilbermc theme. I edited the index.template.php, as instructed in the 1st post (using wordpad, save as text), upload it and get the parse code error! Just like the earlier posts here.
Does anybody here have the edit files for the dilbermc theme? :
index.template, boardindex.template, display.template and message.index
Thanks in advance!  :)
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: Vinspire on October 23, 2006, 09:50:30 pm
Vinspire I will try to do the edits again and see what I can come up with. Another idea would be to ask the author of the theme. Show him the files I edited and see what he can come up with.

Bigguy, i found out the problem with the Helios Eclipse on why we couldn't get it to work already.

In Helios Eclipse, the welcome ads column had been reserved for a logo ...

You go to "Admin -> Configuration -> Themes and Layout -> Themes and Settings -> Helios Multi -> Theme Options and Preferences -> Logo :"

And once you've filled in the image url. This is how it would look like :)

(http://img131.imageshack.us/img131/3599/hliosup3.th.png) (http://img131.imageshack.us/my.php?image=hliosup3.png)

Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: Loki66 on October 24, 2006, 02:52:56 am
Hello Bigguy,

Can you please post the Helios Multi RC3 without the TP as I cannot find which modifications are from TP and which are from you to remove the TP code !

Thanks,

Loki


PS: http://www.monstrous.com/forum
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: Rastarr on October 24, 2006, 05:52:15 am
Hi All,

This looks like a great mod for getting Adsense into SMF. I like a lot of other people am having a tough time with my theme - SMF Live Forum Messanger.
I was wondering whether you might be really helpful and have a look at the alterations of it for me please? I had a go myself and ended up with theme errors staring me in the face  :'(

Cheers and thanks heaps for any help you can lend
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: Loki66 on October 24, 2006, 10:16:02 am
Hello Biggie,

After several hours working on those files, I still have problem with the side tower add.

To make it show up, I have to have it both left and right (or it don't show up) and it kind of damage the skin.

Can you please check my files and see what I have missed to adapt this great mod to Helios Multi RC3, one if not the best SMF "dark" theme.

Thanks,

LK
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: bigguy on October 24, 2006, 10:49:38 am
I am not sure you have missed anything, maybe the towers aren't supposed to show unless both are in. Let's see what Jerm has to say.
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: Loki66 on October 24, 2006, 11:46:26 am
Sorry, I also tried your files and had the same result with the parse error page when clicking on a thread !

I can live without right side banner but the members need to be able to read the posts  :(

Please, let me know if that can be solved ...

Template Parse Error!
There was a problem loading the /Themes/helios_multi11_rc3/Display.template.php template or language file.

Hi,

I tried the files in the zip but I still have the same problem when clicking on a thread link (to read a message) ....

Thanks for your help,

LK


http://monstrous.com/forum/index.php?topic=2798.0


Please check the syntax and try again - remember, single quotes (') often have to be escaped with a slash (\). To see more specific error information from PHP, try accessing the file directly.

You may want to try to refresh this page or use the default theme.

Parse error: syntax error, unexpected $end in .../Themes/helios_multi11_rc3/Display.template.php on line 798

789:                 $moderationButtons[] = '<a href="' . $scripturl . '?action=post;calendar;msg=' . $context['topic_first_message'] . ';topic=' . $context['current_topic'] . '.0;sesc=' . $context['session_id'] . '">' . ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/linktocal.gif" alt="' . $txt['calendar37'] . '" border="0" />' : $txt['calendar37']) . '</a>';
790:
791:         if ($context['can_remove_post'] && !empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1)
792:       $moderationButtons[] = $settings['use_image_buttons'] ? '<input type="image" name="submit" id="quickmodSubmit" src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/delete_selected.gif" alt="' . $txt['quickmod_delete_selected'] . '" onclick="return confirm(\'' . $txt['quickmod_confirm'] . '\');" />' : '<a href="javascript:document.forms.quickModForm.submit();" onclick="return confirm(\'' . $txt['quickmod_confirm'] . '\');" id="quickmodSubmit">' . $txt['quickmod_delete_selected'] . '</a>';
793:
794:         return implode($context['menu_separator'], $moderationButtons);
795: }
796:
797: ?>

798:
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: bigguy on October 24, 2006, 06:07:22 pm
Send me YOUR Display.template.php and I will try to modify it to work.
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: mutya on October 24, 2006, 07:10:41 pm
hello!
The ad mod v2 is now working in my default theme. I'm now trying to make it work for the dilbermc theme. I edited the index.template.php, as instructed in the 1st post (using wordpad, save as text), upload it and get the parse code error! Just like the earlier posts here.
Does anybody here have the edit files for the dilbermc theme? :
index.template, boardindex.template, display.template and message.index
Thanks in advance!  :)
Hi! Tried to edit the index.template.php again, and here is the parse error :
Pls. help me out with this, I'm not really into coding, I just followed the instruction for the dilbermc edit here : http://www.smfads.com/forums/index.php?topic=22.30 (http://www.smfads.com/forums/index.php?topic=22.30)
and here is the error:
Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in .../Themes/dilbermc/index.template.php on line 260

251:                echo $ads['content'];
252:             else
253:                eval($ads['content']);
254:             echo '</td>';
255:          }
256:          unset($ads);
257:    echo '
258:
259:    echo '

260:                <td valign="middle" height="30" style="padding-top:0px; padding-bottom:0px; padding-right:20px;" class="middletext" align="right">

261:             <form action="', $scripturl, '?action=search2" method="post" style="margin: 0px;">
262:                <a href="', $scripturl, '?action=search;advanced"><img src="'.$settings['images_url'].'/filter.gif" align="middle" style="margin: 0px;" alt="" /></a>
263:                <input type="text" name="search" value="" style="width: 190px;" />
264:                <input type="submit" name="submit" value="', $txt[182], '" style="width: 11ex;" />

Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: bigguy on October 24, 2006, 11:57:20 pm
Take the ; out of this and see what happens:

Code: [Select]
padding-right:20px;" class
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: mutya on October 25, 2006, 12:45:37 am
Thanks for the time, bigguy!
I edited but I still get the same error! Here it is:
Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in .../Themes/dilbermc/index.template.php on line 260

251:                echo $ads['content'];
252:             else
253:                eval($ads['content']);
254:             echo '</td>';
255:          }
256:          unset($ads);
257:    echo '
258:
259:    echo '

260:                <td valign="middle" height="30" style="padding-top:0px; padding-bottom:0px; padding-right:20px" class="middletext" align="right">

261:             <form action="', $scripturl, '?action=search2" method="post" style="margin: 0px;">
262:                <a href="', $scripturl, '?action=search;advanced"><img src="'.$settings['images_url'].'/filter.gif" align="middle" style="margin: 0px;" alt="" /></a>
263:                <input type="text" name="search" value="" style="width: 190px;" />
264:                <input type="submit" name="submit" value="', $txt[182], '" style="width: 11ex;" />
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: Loki66 on October 25, 2006, 12:51:14 am
Hello,

Here is my display.template.php.  The mod works fine with the default template.

Thanks,

LK
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: Loki66 on October 25, 2006, 04:53:05 pm
Hello,

Any idea to fix this, did somebody manage to have the banners running with Helios Multi RC3 ?

Thanks,

LK
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: bigguy on October 26, 2006, 11:13:16 am
That is one of the themes that is Very hard to edit. Have you tried going to the theme author, maybe he has idea's as to how or where these edits should go.
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: Rastarr on October 26, 2006, 04:39:09 pm
bigguy,

Is this reference to too hard a theme to edit in answer to Loki66 or to my request for help on the SMF Live Forum Messanger theme ?
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: bigguy on October 26, 2006, 05:47:28 pm
I have not tried the live forum messenger theme yet. I was referring to the helios theme. I have not been able to succesfully edit that template yet.
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: zarrion101 on October 27, 2006, 09:49:12 am
I'm finding it difficult to add the code in my indextemplate.php file with the template Dilbermc powered by 1.1 RC3. I've attached the indextemplate.php. I wonder if someone could pu the code in for me. Thank you.
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: bigguy on October 27, 2006, 03:08:14 pm
Try this:
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: zarrion101 on October 27, 2006, 03:42:09 pm
Try this:

THANK YOU, THANK YOU! It works. :D
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: bigguy on October 27, 2006, 03:43:46 pm
Your more than welcome. I am glad it works for you. Was that an unmodified version of that template file. ???
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: zarrion101 on October 27, 2006, 04:04:36 pm
Your more than welcome. I am glad it works for you. Was that an unmodified version of that template file. ???

Yes I think so.  ::)
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: BlueJayWay on October 27, 2006, 10:29:59 pm
I am using a slightly modified Babylon theme. I managed to get it all edited and the adds a the top display but no where else

http://www.bluejayway.ca/forum/index.php

nm
Getting a parse error when trying to access posts.

Parse error: syntax error, unexpected $end in .../Themes/bjw2/Display.template.php on line 785

776:    if ($context['calendar_post'])
777:       $moderationButtons[] = '<a href="' . $scripturl . '?action=post;calendar;msg=' . $context['topic_first_message'] . ';topic=' . $context['current_topic'] . '.0;sesc=' . $context['session_id'] . '">' . ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/linktocal.gif" alt="' . $txt['calendar37'] . '" border="0" />' : $txt['calendar37']) . '</a>';
778:
779:    if ($context['can_remove_post'] && !empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1)
780:       $moderationButtons[] = $settings['use_image_buttons'] ? '<input type="image" name="submit" id="quickmodSubmit" src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/delete_selected.gif" alt="' . $txt['quickmod_delete_selected'] . '" />' : '<a href="javascript:document.forms.quickModForm.submit();" id="quickmodSubmit">' . $txt['quickmod_delete_selected'] . '</a>';
781:
782:    return implode($context['menu_separator'], $moderationButtons);
783: }
784:

785: ?>

786:
787:
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: bigguy on October 28, 2006, 02:59:29 am
@ zarrion101: Ok, I will post that file for others to use.

@ BlueJayWay: Is this your error or did you get this solved. ??? If you didn't you can send me your template files and i will see what I can do. ;)
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: DoA on October 28, 2006, 04:00:41 am
Using helios_multi theme -->

Fatal error: Call to undefined function: show_threadads() in /home/lazyrec/public_html/testforum/Sources/Load.php(1702) : eval()'d code on line 7


Any help please?
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: WarBirD on October 29, 2006, 07:04:29 am
I would like some help with making the AD Mod visible in the following themes.

http://www.tinyportal.net/smf/index.php?action=tpmod;dl=item357 (WoW RC3 and TPv9.5beta )
http://www.tinyportal.net/smf/index.php?action=tpmod;dl=item416 (Guild Wars RC3 and TP )
http://www.tinyportal.net/smf/index.php?topic=9908.0 (BF2142)
http://www.tinyportal.net/smf/index.php?action=tpmod;dl=item354 (Day of Defeat)

I am not good with code and all that stuff, anyone might tell me if the integration of the AD mod into Custom Themes has changed since the Solution on the 1st Page of that thread, i mean from RC2 to RC3. I might get it to work with doing the same things what is wrote there but I need to know if there is no difference between doing that for RC2 and RC3.

Thx

WarBirD
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: bigguy on October 29, 2006, 07:11:55 pm
That would be a lot of work.
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: botcee on October 31, 2006, 10:06:25 am
Hey buddy i tried to edit as much as i could but im having some problems..please tellme what im doing wrong
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: bigguy on October 31, 2006, 10:54:59 pm
@ WarBirD: I didn't say i couldn't do it. ;)

@ botcee: have you edited this file or is it a un-modified version of your template. ???
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: Rastarr on November 01, 2006, 05:53:52 am
Hi All,

This looks like a great mod for getting Adsense into SMF. I like a lot of other people am having a tough time with my theme - SMF Live Forum Messanger.
I was wondering whether you might be really helpful and have a look at the alterations of it for me please? I had a go myself and ended up with theme errors staring me in the face  :'(

Cheers and thanks heaps for any help you can lend


Hey Guys,

I guess you've prolly got a pile of themes begging for your attention. I'd certainly like to see the SMF Live Forum one that I posted about a while ago to be worked on to get the Ads mod working.

It's a great mod from what I've seen on other forums and I'd certainly appreciate your help in getting it to work on my forum also.

Cheers
Rastarr
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: bigguy on November 01, 2006, 09:06:15 am
Is it in this board by any chance:

http://www.smfads.com/forums/index.php?topic=163.0
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: Rastarr on November 01, 2006, 09:19:48 am
Hey bigguy,

I've looked at that one and unfortunately it isn't there.
I posted the 4 required files on Oct 24th in Reply post #137 on page 10 of this thread. If you aren't able to locate them, I can certainly attach them here once more.

Your help would be greatly appreciated.
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: bigguy on November 01, 2006, 10:15:56 am
Ok you can post them here again and can you also post the version of SMF that you are running and what version of the ad mod. Lately people haven't been very clear about that.
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: Rastarr on November 01, 2006, 05:39:40 pm
Sure, sorry about the lack of clarity.

I'm using SMF Live Forum Messanger theme 1.1 RC2 and the SMF Ads v2.0
The files are attached.

Cheers and thanks again
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: botcee on November 02, 2006, 08:02:36 am
@ botcee: have you edited this file or is it a un-modified version of your template. ???

semi edited version :(
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: bigguy on November 02, 2006, 12:42:23 pm
@ Rastarr: Try this file and see if it works. I am going to do this one at a time so I know which has the error. This one might produce one because of the edit near
Code: [Select]
         </td>
EDIT: I know the BoardIndex.template.php is right so here is that file.
EDIT: The MessageIndex.template.php should be ok to.
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: Rastarr on November 03, 2006, 09:07:25 am
bigguy,

Still testing though looks pretty darn good so far. Certainly look forward to the last file you're working on - thank you so much for your work so far.

Now if I can only get rid of these pesky non-English ads, I'll be in heaven  ;D
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: bigguy on November 03, 2006, 10:29:41 am
So all those work fine then, awesome. Are these NON-edited files. Do they have any other mods installed on them. ??? Here is the last file:
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: Rastarr on November 03, 2006, 10:34:21 am
Bog standard - no mods installed, no past edits done.
Still testing the 3 out of 4 files in off viewing time - looks good though. Haven't tested skyscraper mode yet either.
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: bigguy on November 03, 2006, 10:43:03 am
Ok, if these edits work I am going to zip these for everyone else to use. What theme is this again, lol. (Sorry short memory)
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: Rastarr on November 03, 2006, 10:24:11 pm
I installed the display.template.php file and received the error below:

Code: [Select]
Template Parse Error!
There was a problem loading the /Themes/SLFM/Display.template.php template or language file. Please check the syntax and try again - remember, single quotes (') often have to be escaped with a slash (\). To see more specific error information from PHP, try accessing the file directly.

You may want to try to refresh this page or use the default theme.

Parse error: syntax error, unexpected $end in .../Themes/SLFM/Display.template.php on line 1105

1096: // Finally the most important bit - the actual text box to write in!
1097: echo '
1098: <tr>
1099: <td valign="top" align="right"></td>
1100: <td>
1101: <textarea class="editor" name="', $context['post_box_name'], '" rows="', $context['post_box_rows'], '" cols="', $context['post_box_columns'], '" onselect="storeCaret(this);" onclick="storeCaret(this);" onkeyup="storeCaret(this);" onchange="storeCaret(this);" tabindex="6"></textarea>
1102: </td>
1103: </tr>';
1104: }
1105: ?>
1106:
1107:

I also notice that the 'Display ads in the welcome user area' option plonks an Ad into the News banner section like the attached - is that the position it's meant to be ?

This theme is called SMF Live Forum Messenger over at http://ztut.com/

Cheers
Rastarr
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: bigguy on November 03, 2006, 11:22:11 pm
Ok, rename your display.template.php file to display.template1.php and SMF should pick it up from the default template file. As for were the welcome ads are shown; I can't be exactly sure where they are going to show up as every template file is different. I only go by the edits in the .xml file of the ad mod. If you would like it customized for your theme then that would require a little more work and time, but could be done.
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: Rastarr on November 03, 2006, 11:31:19 pm
Not sure I understand, bigguy.
Do you mean I have both a modded file called display.template.php file and an unmodded original file called display.template1.php and that this fixes the above error?
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: botcee on November 04, 2006, 04:48:22 am
dude i really need to get my index.php fixed...could you please rectiy that thing please?
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: lill-micke on November 09, 2006, 05:12:58 am
Hi!

I use:
Forum: SMF 1.1 RC3
Portal: MKPortal M1.1 Rc1
Theme: pdx-dk03 RC3

I hava installed this grate mod whit the package manager.
And I have alter my theme after the first post in this Topic.
But I have one problem, I get this error when I enter a Topic:

Code: [Select]
Parse error: syntax error, unexpected $end in /hsphere/local/home/bikerlin/bikersite.se/forum/Themes/pdx-dk04rc3/Display.template.php on line 758

I have attachment the four files that have to bee altered (The files that I attached are original and not altered)

Can enyone alter or help me to alter this files so I don't get this error?

//Micke
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: lill-micke on November 09, 2006, 10:19:00 am
I have fixed that problem, but now I have this problem.
I get this error where the Ads will show in the forum:

Code: [Select]
Parse error: syntax error, unexpected '<' in /hsphere/local/home/bikerlin/bikersite.se/forum/Sources/Load.php(1702) : eval()'d code(12) : eval()'d code on line 1

Why do I get this error?
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: bigguy on November 09, 2006, 09:18:00 pm
@ Rastarr: No I mean rename the display.template.php file in your theme to display.template1.php

This way SMF will read off of the default theme for that template file and the edits should already be there.

@ botcee: There are no edits that go ito the index.php file. If I have forgotten about you I am sorry I have been a bit busy lately. Please send me a link to the original post and I will try to get things sorted out for you.

@ lill-micke: Then try doing the same as I have told Rastarr to do. This should take care of that problem.
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: botcee on November 10, 2006, 07:28:58 am
Hey bigguy, really appreciate for your doing this for us.I have added the codes in all the places except index.template.php.Im attaching the untouched version, could you please modify it and give it to me?Thanks a lot
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: botcee on November 11, 2006, 02:34:14 pm
big man, please reply! :(
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: bigguy on November 12, 2006, 03:52:44 pm
@ botcee: um What theme is this. It is completely different then anything I have seen. I don't think I can edit this.
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: Rastarr on November 12, 2006, 07:49:52 pm
@ Rastarr: No I mean rename the display.template.php file in your theme to display.template1.php

This way SMF will read off of the default theme for that template file and the edits should already be there.

OK, I understand. I've done this however all the formatting is now wrong, per the attached example.
Have you been unable to properly insert the ad mod code into this theme?
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: BlueJayWay on November 13, 2006, 12:51:43 am
@ BlueJayWay: Is this your error or did you get this solved. ??? If you didn't you can send me your template files and i will see what I can do. ;)

The error I got after editing.
The files are attached, thank you.

Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: botcee on November 13, 2006, 12:52:33 am
Im using rockethemes smf_fire
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: mutya on November 13, 2006, 03:33:47 am
hello bigguy,
still have the same problem with the parse error  :(
can you pls. help? see the error below:
thank you!

Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in .../Themes/dilbermc/index.template.php on line 260

251:                echo $ads['content'];
252:             else
253:                eval($ads['content']);
254:             echo '</td>';
255:          }
256:          unset($ads);
257:    echo '
258:
259:    echo '

260:                <td valign="middle" height="30" style="padding-top:0px; padding-bottom:0px; padding-right:20px" class="middletext" align="right">

261:             <form action="', $scripturl, '?action=search2" method="post" style="margin: 0px;">
262:                <a href="', $scripturl, '?action=search;advanced"><img src="'.$settings['images_url'].'/filter.gif" align="middle" style="margin: 0px;" alt="" /></a>
263:                <input type="text" name="search" value="" style="width: 190px;" />
264:                <input type="submit" name="submit" value="', $txt[182], '" s
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: bigguy on November 13, 2006, 09:17:03 pm
Try taking out the extra echo on line 259. I don't think 2 are need there. See if that helps. That looks wrong to me to echo statements in the same place.
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: bigguy on November 13, 2006, 09:20:40 pm
@ BlueJayWay: Try this, backup first:
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: mutya on November 14, 2006, 11:02:17 pm
Try taking out the extra echo on line 259. I don't think 2 are need there. See if that helps. That looks wrong to me to echo statements in the same place.
it worked! you're the guy, bigguy! tnx!  :)
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: Nikitostik on November 15, 2006, 09:09:54 am
Hi all! I have a problem to, if i edit some sing in index.themplate.php i see only errors and my board dont open
maybe you (bigguy) can look it. Theme is Ih-oh  and SMF 1.0.9

Thanks in Advice!
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: angie1791 on November 15, 2006, 12:30:00 pm
Just want to say THANKS bigguy!  Your modifications work great! I am using Ig-Oh theme (1.1 RC3) and was able to get it working with no further modifications.

You're awesome!   ;)

Ange
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: bigguy on November 15, 2006, 03:30:13 pm
@ Nikitostik: try this.

@ angie1791: You are more than welcome.

Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: Nikitostik on November 16, 2006, 07:42:14 am
Thanks but the same, board show me folloing error: Template Parse Error!
There was a problem loading the /Themes/igoh10xb/index.template.php template or language file. Please check the syntax and try again - remember, single quotes (') often have to be escaped with a slash (\). To see more specific error information from PHP, try accessing the file directly.

You may want to try to refresh this page or use the default theme.
----------------------------
i cant edit nothing, if i edit somesing, board shows me errors
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: axlarry on November 17, 2006, 02:05:38 pm
bigguy, thanks for this mods and the tips. I have done all the editing, except for the index.template.php as I can't find any code that I have to edited  :'( As I said on another thread, I'm using RC3 and orange-lt2 theme. Would you pls look into the file?

Thanks bigguy :)
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: BlueJayWay on November 17, 2006, 06:00:05 pm
@ BlueJayWay: Try this, backup first:
Thanks
Tried it still getting parse error and also not tied to background colours and images.

Ill post the parse error latter tonight to see if its the same.
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: thelaw on November 30, 2006, 04:22:36 pm
Hello,

I just installed the mod successfully, well, just installed, because it is not really working. I am getting two errors, or better to say i am not getting two things that i was supposed to get after installing the ad mod.

1st. Ad mod doesn't display ads on theme Epsilon (i searched around on this forum, but it was impossible to find a fix for that theme, so i found this topic and tried to make the necessary modifications but then i was halted, on this theme, i can't find the // Show the "Powered by" line on index.template.php so i had to stop editing before i messed up everything).

2nd. Even on the default theme when i go on Admin section, i do not see the Ad Manager link, i have to go on  Edit Features and Options to be able to see the Ad Management (tho, i still won't be able to see the additional options like to chose on which topic to display this ad, or to name a ad) all i see is the input boxes for:
    Display ads on every page (ontop)     
   Display ads on every page (onbottom)    
   Display ads on Board Index    
   Display ads on Thread    
   Display ads on Thread Index    
   Display ads after first post
and the textarea for adding the code.

 Anyone can point me to the right direction? Has anyone modified already his Epsilon theme style and made it work with Ad Manager ?

 Thank you

p.s. the ad manager works just fine (except the fact that i can't find the Ad Manager link on Admin section) with the default theme.
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: Jjciantar on December 02, 2006, 04:59:33 am
Hello, I'm new to the forums, but I tried installing it manually I get this error.

Quote
Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in .../Themes/orange-lt03/index.template.php on line 174

165:
166:             current_header_ic = mode;
167:          }
168:       </script>
169: </head>
170: <body id="page_bg">
171:    //Display ads on the top of the page
172:    $ads = show_topofpageAds();   
173:    if(!empty($ads))

174:       if($ads['type']==0)

175:          echo $ads['content'];
176:       else
177:          eval($ads['content']);   
178:    unset($ads);

I don't know what to do. My theme I use is called Orange-LT
http://themes.simplemachines.org/index.php?lemma=155

Could you please help me.
If you need to contact me my AIM is Jjciantar.
I'd like this done as soon as possible.
Your help will be appreciated.
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: cslepage on December 02, 2006, 09:01:40 pm
I just updated my SMF board to 1.1:

http://smileysmile.net/board/

As I use the Helios theme, I have to do the manual edits.  I get errors for any of the edits for display.template.php.
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: Jjciantar on December 02, 2006, 09:17:52 pm
Yes I tried doing it again. It gave me this:

Quote
Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in .../Themes/orange-lt03/index.template.php on line 194
Quote
185:                 }
186:              echo '
187:             </div>
188:          </div>
189:       </div>
190:       
191:    //Below the menu ads
192:    $ads = show_indexAds();   
193:    if(!empty($ads))

194:       if($ads['type']==0);

195:          echo $ads['content'];
196:       else
197:          eval($ads['content']);
198:    unset($ads);

Again, I'd like this done ASAP.
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: bigguy on December 03, 2006, 11:49:20 am
@ cslepage: rename your display.template.php file and see if that makes a difference.

@ Jjciantar:  On that line 174 ad a ; to the end of it so it would be like this: 
Code: [Select]
if($ads['type']==0);
@ thelaw: check your modifications.english.php file and see if the edits were done there.
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: Jjciantar on December 04, 2006, 12:44:48 am
If you look at my second post it's already like that.
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: thelaw on December 04, 2006, 05:14:38 am
 Hello bigguy,

I do see some modifications on modifications.english.php (on default theme, not on epsilon, on Epsilon theme that file doesn't even exist).

What i do see are two files
Quote
   Modifications.english.php
   Modifications.english.php~

On Modifications.english.php file i see this
Quote
<?php
// Version: 1.0; Modifications

// Js - Strings

$txt['js_ads_title'] = 'Ad Management';
$txt['js_text_displayads_index'] = 'Display ads on every page (ontop)';
$txt['js_text_displayads_botindex'] = 'Display ads on every page (onbottom)';
$txt['js_text_displayads_board_index'] = 'Display ads on Board Index';
$txt['js_text_displayads_display'] = 'Display ads on Thread';
$txt['js_text_displayads_message_index'] = 'Display ads on Thread Index';
$txt['js_text_displayads_firstpost'] = 'Display ads after first post';
$txt['js_text_disc'] = 'Write your code here';
$txt['js_text_help'] = 'Make sure that your code is compatible with HTML';
$txt['permissiongroup_ad_manage'] = 'Ad Management';
$txt['permissionname_ad_manageperm'] = 'Enable ads';
$txt['permissionhelp_ad_manageperm'] = 'To enable ads to appear for this membergroup, this must be checked';

?>

While on Modifications.english.php~ file i see this
Quote
<?php
// Version: 1.0; Modifications

?>

Should i remove Modifications.english.php~ or it can sit there? The ads will show only on the default theme and without all the futures (as i stated on the previous post), while on Epsilon theme it will not show at all.

Thank you.
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: bigguy on December 04, 2006, 10:05:42 am
Move the modification.english.php file into the theme's langauge folder you are using. If there is no langauge folder than create one.
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: thelaw on December 05, 2006, 03:18:16 am
 Hello again bigguy,
I just moved the modifications.english.php file from the default theme to the Epsilon theme, now i do see the tab for displaying ads (not directly from the menu, but from Edit Features and Options) yet, the ads will not display on the theme.

Here is a link to the forum singleforums.com (http://singleforums.com)

note: I have not made the modifications to the files as posted by you in the beginning of this thread since i couldent find the line // Show the "Powered by" in index.template.php file of the theme.

 Thank you.
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: bigguy on December 06, 2006, 08:25:16 am
Try renaming some of the files you cannot edit. Doing this will make SMF use the default templates were the edits are already done. If you rename a file and your forum starts to look wierd just rename it back to the original name. Also if you cannot find an entire line of code that must be edited try searching for part of that line, that usually works.
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: thelaw on December 06, 2006, 10:20:54 am
 Hello bigguy,

Problem solved, ads are now showing...but i still can't add different ad groups, i can use one single ad for everything.

What changes are required to be able to solve this issue and add different ads for different parts of the forum?

Thank you
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: bigguy on December 06, 2006, 05:40:13 pm
How many template files did you rename in the custom theme you are using. ??? The ones you did not rename will have to be edited manually. also, you can have 2 ads show in the same spot, after a refresh of the page the ads will rotate.
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: thelaw on December 07, 2006, 10:53:01 am
 Hello bigguy,
I renamed two files, Border.index and Display.index files. I would really appriciate if I could add different ads for different threads, it would of be very usefully feature.

 Thank you.
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: yeehaa on December 07, 2006, 11:00:35 pm
I used the edits in the Ig-Oh theme and it gave me a bunch of errors.

I found that I was having problems copying the format and pasting it in the files correctly-

Does the spacing of the edits need to be the same? whenever I pasted the edits into the file (using PSPad freeware) it was aligning the edits to the left.
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: Jjciantar on December 08, 2006, 02:49:05 am
I have a question. It says <td>&nspb</td>; or something similar. Is it the same as
Code: [Select]
                          </td>?

If so, where should I edit?
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: bigguy on December 09, 2006, 10:02:38 am
follow the edits I have posted and you should be fine. That particular edit is a bit tricky. You could get a copy of the default theme and search for that edit in it to see what code is around it, that way you will or should know approximently were to edit the other file.
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: Drea on December 17, 2006, 05:07:31 pm
I can't figure this out for the orange it2 theme its different then others. can anyone help please?
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: wholesales4u on December 18, 2006, 01:21:01 am
I uploaded the edited files to get babylon to work with the ad system
but when I go into the forum and look at a post I get an error

Parse error: parse error, unexpected $ in .../Themes/babylon/Display.template.php on line 785


What do I do? :-\

Is there any other template that will work without editing that I can just download?


thanks
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: thelaw on December 28, 2006, 05:13:19 pm
Hello bigguy,

Okey...SMF V1.1.1 is back, and so am I.

I updated SMF V1.1.1 using Epsilon theme Epsilon (epsilon11RC2).
Once i updated the SMF version, i had to also reinstall Ad Manager, installed it and now it shows me all options as earlier stated that i couldn't see those options. But now, the main problem is...that the ads won't display.

Any ideas what is causing this? Help will be appreciated, forum now runs on default theme (that way it displays the ads) www.singleforums.com

Thank you
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: bigguy on December 28, 2006, 07:31:29 pm
What template files do you have in the epsilon11RC2 folder.
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: thelaw on December 28, 2006, 07:39:23 pm
Folders:
  images
  languages
file under language folders "Modifications.english.php"

Files in the epsilon11RC2:
   BoardIndex.template.php
   Display.template.php
   MessageIndex.template.php
   Settings.template.php
   Themes.template.php
   index.php
   index.template.php
   style.css
   theme_info.xml
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: bigguy on December 28, 2006, 07:47:59 pm
Rename these 3 files:

BoardIndex.template.php
Display.template.php
MessageIndex.template.php

to:

BoardIndex.template1.php
Display.template1.php
MessageIndex.template1.php

and see how the forum looks. If it still looks like epsilon then all you have to do is edit the index.template.php
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: thelaw on December 28, 2006, 07:52:29 pm
 Hello bigguy,
I just made the changes and renamed the files , the forum sure looks like the epsilon theme, but the problem is that the ads are not showing www.singleforums.com for preview.
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: bigguy on December 28, 2006, 08:05:23 pm
Where do you have them showing on the forum like where are they set to show in the admin panel.
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: thelaw on December 28, 2006, 08:26:06 pm
Where do you have them showing on the forum like where are they set to show in the admin panel.

Display ads on board index
Display ads on thread index
Display ads on thread

This is checkbox i have select where the ads to show, they are supposed to display on all threads as i have left empty the input for "Which boards should this ad display in" ?

If you want, i can change into default theme, so you can have a better picture, but thing that would not be necessary since it displays the ads exactly on the checked boxes as explained above.
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: imschur on December 28, 2006, 11:29:43 pm
Hello

Im redirected from this thread. Im trying to work the ad mod out in the azure theme. I read the information in this thread but Im still a bit puzzled. My theme folder doesnt have all the files listed in the beginning of this thread so Im pretty sure Im missing something obvious. ive attached an image of the azure theme directory. Any help would be appreciated.

Tia
Andrew
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: bigguy on December 29, 2006, 03:44:47 pm
@ imschur: Just do the edits for the indx.template.php file then or rename it to index.template1.php

@ TheLaw: I might have to take a closer look at this. If all the edits are in and it is still not showing then there has to be a problem with the theme somewhere.
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: imschur on December 29, 2006, 03:48:15 pm
@ imschur: Just do the edits for the indx.template.php file then or rename it to index.template1.php

@ TheLaw: I might have to take a closer look at this. If all the edits are in and it is still not showing then there has to be a problem with the theme somewhere.

Thank you
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: bigguy on December 29, 2006, 04:02:37 pm
Your very welcome. :)
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: ziya on January 01, 2007, 04:51:50 am
Hi Bigguy,
Happy New Year,
I had a problem
I am using Juno theme designed by Bloc.
My ads which are below the menu are displaced from center but the lower down ads are at an exact center.
Please check  it here.....

www.stockbazaar.co.in/forum

please suggest me.
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: thelaw on January 02, 2007, 06:29:08 pm
EM...now this mind sound a little embarrassing for me... but since with the older version of SMF i did not had to make any of the edits to make Ads Manager work with Epsilon theme...after the update i also did not made any changes to the theme.

With the previous version of SMF i only changed some file names of the theme and everything worked, i.e. i did not edit any code... so, i guess I will have to edit some code this time ;) .... but as far as i remember (can't get back and look in the thread at this moment, but i will once i post this) there was a part/code/line that i was not able to find in the Epsilon theme, that's why and you adviced me then to make the file name changes and everything worked.

I will try now to make the necessary changes of the code and see if it will work.


Thank you bigguy ;)
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: thelaw on January 02, 2007, 06:46:30 pm
 damn, i just lost bigguy for few seconds...he was here a minute ago :/...

Anyway, i made the changes as posted in the beginning of this thread... i am getting error on Display.template.php file...this is the error i get

Quote
There was a problem loading the /Themes/epsilon11rc2/Display.template.php template or language file. Please check the syntax and try again - remember, single quotes (') often have to be escaped with a slash (\). To see more specific error information from PHP, try...

Parse error: syntax error, unexpected $end in .../Themes/epsilon11rc2/Display.template.php on line 787

And on line 787 of Display.template.php Is the next (787: is the line number)

Quote
787: ?>
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: thelaw on January 06, 2007, 04:39:14 pm
 Fixed the problem. It was all sitting in this code
The </td></tr>'; } was replaced, but the } was missing in the replaced code. So just by adding } made everything work.

Ty ty

In "Display.template.php" FIND:

In the same file find:

Code: [Select]
</td></tr>';
}

And REPLACE with: (fixed/edited/added the missing } )

Code: [Select]
</td></tr>';
       }
if ($adpost = show_posts($adcounter))
{
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">? <b>', !empty($message['counter']) ? $txt[146] . ' #' . $message['counter'] : '', ' ', $txt[30], ':</b> ', $message['time'], ' ?</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>';
}

}

New problem, heh, people can't view their posts. You can view the thread, see that there is a post...but, once you get inside the topic you are not able to see the post, all i see is the Ads....this thing is frustrating me ....
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: jerm on January 08, 2007, 01:46:59 am
I believe you need to take this off
Code: [Select]
</td></tr>';
       }

The one at the top of the code you pasted.
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: thelaw on January 08, 2007, 02:51:05 am
Unfortunately if i remove that it kills the forum when i try to read a post.

Would you guys mind if i paste the whole Display.index.php code file here?
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: bigguy on January 08, 2007, 12:08:47 pm
Jerm is right this part of the code gets replaced, it should not be there:

Code: [Select]
</td></tr>';
       }
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: underdog on January 08, 2007, 12:46:58 pm
Well first thx for the explonation how to change the ad-mod. I'm looking for so long and I hope that it will work.
U said to look for template_menu. Well I use PHP designer 2007 and search for it but I can't find it!!! Do I have to put it then by my self and if it is where do I've to put it? I use pdx-dk06 theme
Thx man!!!!!
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: bigguy on January 08, 2007, 01:09:20 pm
Can you post the 4 template files here and I will take a look.
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: underdog on January 08, 2007, 01:48:08 pm
Ok I put theme as attach

thx  ::)
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: bigguy on January 08, 2007, 03:07:29 pm
I couldn't find a place for the welcome ads so I hope they show in the right place but this file should work.
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: underdog on January 08, 2007, 11:45:06 pm
thx but I see that the other php files wernt there so I try again

thx again
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: bigguy on January 09, 2007, 01:19:51 am
Did that one work. I will have to get to this tomorrow as it's late here.
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: thelaw on January 09, 2007, 09:02:57 am
Ok...
removing the <td><tr>; } would cause me this error
Quote
Template Parse Error!
There was a problem loading the /Themes/epsilon11rc2/Display.template.php template or language file. Please check the syntax and try again - remember, single quotes (') often have to be escaped with a slash (\). To see more specific error information from PHP, try accessing the file directly.

You may want to try to refresh this page or use the default theme.

Parse error: syntax error, unexpected '>' in .../Themes/epsilon11rc2/Display.template.php on line 543

Using the code as it is replaced the <td><tr>; } (i.e. without the } ) is causing me this error
Quote
Template Parse Error!
There was a problem loading the /Themes/epsilon11rc2/Display.template.php template or language file. Please check the syntax and try again - remember, single quotes (') often have to be escaped with a slash (\). To see more specific error information from PHP, try accessing the file directly.

You may want to try to refresh this page or use the default theme.

Parse error: syntax error, unexpected $end in .../Themes/epsilon11rc2/Display.template.php on line 788

And on line 788 you will find ?> .... heh

.. So far i have kept SMF Default theme since Epsilon didn't worked. But to let you all have a better view of the error i will leave it on Epsilon theme. To view the error try to read one of the topics.
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: Abby on January 09, 2007, 11:44:51 am
Thank you for posting this excellent 'how to'.  It was easy to understand and worked like a dream!
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: underdog on January 09, 2007, 02:59:51 pm
Did that one work. I will have to get to this tomorrow as it's late here.

I get this error:
Fatal error: Call to undefined function: show_topofpageads() in /home/underdog/public_html/forum/Sources/Load.php(1724) : eval()'d code on line 205
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: underdog on January 09, 2007, 03:23:06 pm
By install ad-mod 1-1-1_v2 I get this error: Fatal error: packageinstall() [function.require]: Failed opening required '/home/underdog/public_html/forum/Packages/temp/ad_mod_1-1-1_v2/install.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/underdog/public_html/forum/Sources/Packages.php on line 549


mmmmmmm :(
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: underdog on January 20, 2007, 02:54:15 am
 :'( It's still not working I get the same error over and over again!!
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: bigguy on January 20, 2007, 06:35:34 pm
Is "Loadads.php" file in the Sources directory. ???
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: soul.guardian on January 30, 2007, 04:59:45 pm
Help BigGuy,

Allright so I tried this out and I kept getting errors.
So here are my four files. Can anyone here help me?

SMF. 1.1.1.  and Orange_it 1.1 theme.

SG
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: bigguy on February 01, 2007, 11:43:45 am
I think I just did these for you in another thread. ???
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: hyipcharts on February 12, 2007, 07:04:52 am
I am using Mercury theme final. I am sure I followed the set-up exactly as shown, I hope. My problem after doing all the code replacing I get an error.


Fatal error: Call to undefined function: show_topofpageads() in /home/content/h/y/i/hyipcharts/html/forum/Sources/Load.php(1724) : eval()'d code on line 148

Let me know if you need any code or where I can fix this.

http://www.hyipcharts.com (http://www.hyipcharts.com)  link to my site.

Thanks
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: bigguy on February 12, 2007, 08:49:22 pm
Make sure LoadAds.php is in the Sources directory and that all the edits are done for the index.template.php and the index.php file.
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: Johno on March 05, 2007, 05:41:00 pm
I'm using SMF 1.1.2 wrapped in Joomla with the smf_versatility theme....

has anyone managed to get this working with a joomla wrapped board?

Cheers.
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: iseeuu on March 06, 2007, 05:51:08 pm
This is my first web site and my first attempt at a forum.  SMF rocks!  And this ad mod could really make it easy to rotate ads in and out of the forum, if I can get it to work with my theme.

SMF version 1.1.2, ad mod version 2.3

I modified the classic YaBB SE Theme (1.1 rc2) with my own colors and graphics. (I couldn't figure out how to install one of the many themes available)  I grabbed some full banner and skyscraper ads to test with.  Ads show in default theme.  However, the full banner ad at the bottom of the page floats left.  Nothing I tried would change the placement ie: adding "align="center" to the code or modifing the css.  I would like the horizontal ads to center.  I don't think I will use the skyscraper ads.

After reading several posts here, I went looking around.  I tried editing the template files myself and got the skyscraper ads on the right, and some banner ads at the bottom, under the menu, on the post page but they were not centered and messed up the format.  I grabbed the files here: http://www.smfads.com/forums/index.php?topic=334.0  but they did not fix the ad mod either.

I reinstalled the original Yabb SE theme and reinstalled the ad mod.  If I can get it to work with YaBB SE, I can add my color changes again and it should work fine.

There is no big rush at my end, but it would be nice to be able to "place" ads in my forum with the ad mod.  If some one has the mod files for
   SMF version 1.1.2,
   ad mod version 2.3
   classic YaBB SE Theme (1.1 rc2)
   I would really like copies.  The files here were close: http://www.smfads.com/forums/index.php?topic=334.0 Maybe they just need some tweeking?

With appreciation,

Robert McMellen
infinitecomputerworks.com
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: bigguy on March 06, 2007, 08:46:37 pm
Did you use the edits for the ad mod for rc3 or the edits for 1.1.2 ???
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: iseeuu on March 06, 2007, 09:58:04 pm
Not sure, purdy confusin sometimes.  I think I copied the wrong link in my post:   ::)

http://www.smfads.com/forums/index.php?topic=334.msg1708#msg1708

anilkuchana was using 1.1 RC3

then willi1 said: "the changes are different to the vers. 1.1 rc2"

I copied the files willi 1 posted and the one bri posted

and I tried the "classic.zip"  file with the template.index

But first I copied your edit instructions that started with:
In your theme directory find and open index.template.php and search for:

Code:

<body>';


I was even able to find the elusive "</td>" by looking at the default index.template.  I edited the four "template" files.

Then there was another set of instructions which was very confusing because it said to:

In the same file search for:

Code:

   template_menu();


Then add BEFORE:

Code:

when the first set of instructions (the ones I tried) said:

In the same file find:

Code:

   template_menu();


After that add:

Code:

So I am still not sure whether to edit before or after?

If you can point me in the direction of files or edit instructions for:

SMF version 1.1.2,

ad mod version 2.3,

Classic YaBB SE Theme (1.1 rc2)

I would gladly spend another couple of days trying to do the edits myself.  Every project I do I learn so much.

Robert
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: bigguy on March 06, 2007, 10:11:45 pm
"In the same file search for:" means in the one you are still editing as in the index.template.php file.
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: iseeuu on March 06, 2007, 10:29:46 pm
Very true.

What confused me was first to

find:  Code: template_menu();

After that add:

Code:  //Below the menu ads
      if (function_exists("show_indexAds")

When the other set of instuctions said to find the same code: template_menu();

Then add BEFORE: Code:
   //Below the menu ads
   $ads = show_indexAds();   

So, in one case you put "//Below the menu ads" BEFORE code: template_menu();
but in the other you put "//Below the menu ads" AFTER code: template_menu();

But what do I know?  We are working with different versions of SMF, YaBB, and the Ad Mod.  I just don't want to give up because I am so close to getting it to be fully functional.  I just need to find the right combinations for the versions I have?

Robert  :})
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: bigguy on March 07, 2007, 08:21:12 am
Follow the instructions for the version of ad mod you are using and you should be fine. Having a editor that can debug is also a plus. ;)
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: cashswede on March 07, 2007, 05:31:07 pm
In the first file I only fin this:<body onload="init()">';
is that the right sentence?

I use the triton theme

Attached the files, very greatful for any help :)
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: iseeuu on March 08, 2007, 08:17:13 am
Well bigguy;

I have accomplished just about as much as my limited skill will allow.  I have banner ads showing and centered.  Tower ads not working.  Pushes the forum layout down underneath the ad;  but since I didn't like the obtrusiveness of the big ads, I not going to use them anyway.  I can't help being proud of the placement of the "welcome" ad.  Using "colspan" and "rowspan" and moving the ad script between the login name and the date, I was able to make another column in my customized header for square ads.  I think it fits nicely, and the color scheme is awesome. 8)

Two things really helped. One was figuring out what version to use.  The second was to go back to the original Classic YaBB theme and get it working.  Since my theme started there, once it was working it was a lot easier to edit in my customizations to get back to my theme's appearance.

Bigguy, I really appreciate all you have done so that the ad mod (which is an awesome idea in of itself) will work with so many themes and variations.  You may have thought of this already, but in upcoming releases of SMF, if the spaces for ads were "built in" where customizing could work around those spaces without changing them, the ad mod would be a cinch to setup and use.

One last comment, it was very reassuring to see your reply to my post so quickly.  Awesome! ;D
(I will thank you with $ if and when my site generates some $)

Robert
http://www.infinitecomputerworks.com/
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: bigguy on March 10, 2007, 11:58:42 am
Glad you got it working. If there is anything else I can do just ask. :)
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: hongster on March 10, 2007, 02:57:08 pm
Hi Bigguy,

Thanks for your distribution for ads mod it quite useful for forum users and it works fine with my default theme. However when I switched my theme to rocket theme versatility 2 sienna and try to do the manual install, I found out some difficulty due to skill limitation, I would like to ask you to take a look for my themes coding and give me some advices.

Thanks and regards,
Hongster
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: bigguy on March 10, 2007, 07:28:53 pm
These files already have the ad mod edits in them ???
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: hongster on March 11, 2007, 02:35:03 am
Havent yet, I tried to add in myself but the coding for rocket themes versatility 2 is totally different with the default themes, therefore i duno how to manual install into the coding part especially for index.template.php. Could you give me some hints how to add in to the themes.

Thanks and regards,
Hongster
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: bigguy on March 11, 2007, 10:34:48 am
When I get back today I can probably.
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: rav33n on March 15, 2007, 03:36:52 pm
Hey, I'm having some trouble manually modifying the index.template file of my custom theme "PSPTheme". I think the problem is that there is no "template_menu();" in the file, but there are two instances of template_menu()... that is without the ";".

I've attached the file. Would be greatful if you could explain how to fix this problem. Or if you could make the changes yourself it'd be great :).

Thanks,
Rav
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: bigguy on March 15, 2007, 06:28:39 pm
Thier shouldnt be two instances of it. Putting the appropriate edit after one of them would be correct. I am not familiar with this theme. Was it released at simplemachines.org.
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: rav33n on March 15, 2007, 06:32:42 pm
Yes its on the official site -
http://custom.simplemachines.org/themes/index.php?lemma=215

I get errors in index.temlplate.php when i make the edits.

http://www.gamer.lk is the forum in question.
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: bigguy on March 15, 2007, 06:35:24 pm
Is this for RC2 ???
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: rav33n on March 15, 2007, 06:39:16 pm
1.1.2

Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: bigguy on March 15, 2007, 06:46:39 pm
Well, try this out.
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: rav33n on March 15, 2007, 07:02:51 pm
Quote
Template Parse Error!
It seems something has gone sour on the forum with the template system. This problem should only be temporary, so please come back later and try again. If you continue to see this message, please contact the administrator.

You can also try refreshing this page.

:(
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: bigguy on March 15, 2007, 07:05:24 pm
What version of ad mod do you have installed. ???
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: rav33n on March 15, 2007, 07:07:36 pm
ad_mod_1-1-x_v2-3

from here http://custom.simplemachines.org/mods/index.php?mod=255
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: bigguy on March 16, 2007, 09:51:39 am
Rename the index.template.php file to index.template1.php and see what happens.
Title: Re: Edits for ad_mod_rc2_v2 for Remorse Lite Theme
Post by: maldo on April 08, 2007, 12:46:30 pm
Hello there,

Can any one help me to edit the theme files to work with ad management for the Remorse Lite Theme , I made a search in the forum and I don't think anyone has the edited files for that theme.

I tried to edit using the instructions above but a few of the codes to find and edit are missing in this theme, very confused, please help.

I am attaching the files.

Any help is very much appreciated.
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: rhommel on April 09, 2007, 10:01:33 am
Havent yet, I tried to add in myself but the coding for rocket themes versatility 2 is totally different with the default themes, therefore i duno how to manual install into the coding part especially for index.template.php. Could you give me some hints how to add in to the themes.

Thanks and regards,
Hongster

I also have this theme ( rockettheme's Versatility 2 template) I am also having a difficulty with this mod. Can you help us out? Thanks!
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: bigguy on April 09, 2007, 08:37:06 pm
Are these files un-edited. ???
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: vlad230 on April 15, 2007, 06:12:20 am
I can't find this line:
Quote
</td></tr>';
   }
I have looked at the file like 4 times and I can't see that line.....:(
I'm using the smfone_green template
Pls help
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: bigguy on April 16, 2007, 06:35:01 pm
Try searching for just part of the line. Or are you looking for it manually. ???
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: vlad230 on April 17, 2007, 12:35:54 pm
Try searching for just part of the line. Or are you looking for it manually. ???
Yeah... I was looking for it manually  :o
Used the find tool from dreamweaver but the closest thing that it finds is:
Code: [Select]
// Show the post itself, finally!
echo '
</td>
</tr></table>

<div class="post"', $message['can_modify'] ? ' id="msg_' . $message['id'] . '"' : '', '>', $message['body'], '</div>', $message['can_modify'] ? '
<img src="' . $settings['images_url'] . '/icons/modify_inline.gif" alt="" align="right" id="modify_button_' . $message['id'] . '" style="cursor: pointer;" onclick="modify_msg(\'' . $message['id'] . '\', \'' . $context['session_id'] . '\')" />' : '' , '
</td>
</tr>';

// Now for the attachments, signature, ip logged, etc...

No "}"  ???
strange....
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: Flama on April 21, 2007, 09:48:03 pm
Hi all!
First i want to say thanks for this nice mod! ;)

What i have
SMF 1.1.2
Versatility2 from Rockettheme

What is working
Display ads on board index
Display ads on message index
Display ads on the post page
Display ads after the last post

Not working
Display ads on every page right below the menu
Display ads on the bottom of the page
Display ads on every page as a tower on the right side
Display ads on every page as a tower on the left side

I've succesfully modified BoardIndex.template.php, Display.template.php, MessageIndex.template.php

The issue is with index.template.php
No matter where i put the code, the ad's simply refuses to show me. :idiot:

I know that only one simple step is needed to make this mod fully working with Versatility2 theme, but (yet) cannot figure it out what is wrong.  :-\

I've attached modified BoardIndex.template.php, Display.template.php, MessageIndex.template.php(moded.zip) and unmodified index.template.php + screenshot of a partially working mod.

Maybe Ads.template.php need some modifications too?
I would be very happy if somebody can put me in the right direction! ;)

Versatility2 users united!  ;D
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: ange1us on April 21, 2007, 10:21:18 pm
Hi all!
First i want to say thanks for this nice mod! ;)

What i have
SMF 1.1.2
Versatility2 from Rockettheme

What is working
Display ads on board index
Display ads on message index
Display ads on the post page

Not working
Display ads on every page right below the menu
Display ads on the bottom of the page
Display ads on every page as a tower on the right side
Display ads on every page as a tower on the left side

I've succesfully modified BoardIndex.template.php, Display.template.php, MessageIndex.template.php

The issue is with index.template.php
No matter where i put the code, the ad's simply refuses to show me. :idiot:

I know that only one simple step is needed to make this mod fully working with Versatility2 theme, but (yet) cannot figure it out what is wrong.  :-\

I've attached modified BoardIndex.template.php, Display.template.php, MessageIndex.template.php(moded.zip) and unmodified index.template.php + screenshot of a partially working mod.

Maybe Ads.template.php need some modifications too?
I would be very happy if somebody can put me in the right direction! ;)

Versatility2 users united!  ;D


Holy GOD !!!!

IT WORKS

MANY THANKS  ;D ;D ;D
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: liberte on May 06, 2007, 06:51:01 am
Hi
for newbies

The logic is very simple
If you are not sure where to put related ad code in your SMF Theme,
just open your default theme

look at the place of the ad

then open your favorite theme
try to find similar place at your favorite theme, for instance insert
a word like "hhhhhhhhhhhhhhhhh" into your codes
if you feel ok with the place that "hhhhhhhhhhhhhhhhh" is seen
then replace the ad code there.

Just trial and error, nothing to lose.
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: mehalaktas on May 07, 2007, 05:00:28 am
Hi everybody
I have problem with my ad mannegment mod. I add the problem's picture.
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: most_wanted on May 13, 2007, 04:00:43 am
using lightning01 theme and getting this error
Code: [Select]
Parse error: parse error, unexpected $ in .../Themes/lightning01/Display.template.php on line 755

746: </td>
747: </tr>
748: </table>';
749: }
750: if ($context['show_spellchecking'])
751: echo '
752:  <form action="', $scripturl, '?action=spellcheck" method="post" accept-charset="', $context['character_set'], '" name="spell_form" id="spell_form" target="spellWindow"><input type="hidden" name="spellstring" value="" /></form>';
753: }
754:

755: ?>

756:
757:

Display.template.php attached
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: bigguy on May 25, 2007, 02:29:59 pm
Is 755 the end of the file. ???
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: most_wanted on May 25, 2007, 03:30:36 pm
yes it is....
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: bigguy on May 25, 2007, 06:06:38 pm
Try this:
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: most_wanted on May 25, 2007, 07:59:16 pm
works great...thanks alot! :)
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: bigguy on May 27, 2007, 11:28:42 am
No problem. :)
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: trulu on June 10, 2007, 12:27:23 am
help i've a problem with managepermission.php when i want to install it, it say test failed. should i ignore this or not? what is the code that i should put in the managepermission.php if i ignore it? TQ
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: trulu on June 12, 2007, 08:57:35 am
help me plzz anyone T_T
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: ITA003 on June 12, 2007, 12:18:39 pm
Do you have some mods that works with manage permission?

Which mods do you have installed?

You can try to unistall that mods and try to re-install Ads Mod...
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: bigguy on June 12, 2007, 05:06:21 pm
All the code can be found stickied to the top of the Theme Support board.

help i've a problem with managepermission.php when i want to install it, it say test failed. should i ignore this or not? what is the code that i should put in the managepermission.php if i ignore it? TQ
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: lord on June 16, 2007, 03:47:18 am
i FOudn out my default theme works with the ad mod.
HOWEVER my template Rockettheme Versality doesnt work.

I saw those edit yourself procedures how finding the code and puttiing more stuff in it. HOwever i couldnt find most of the codes in my index.template.php
 SITE HERE (http://www.xeptic.com/forums)

HEREs my index.template.php SOME one PLZ help

<?php
// Version: 1.1 RC2; index

/*   This template is, perhaps, the most important template in the theme. It
   contains the main template layer that displays the header and footer of
   the forum, namely with main_above and main_below. It also contains the
   menu sub template, which appropriately displays the menu; the init sub
   template, which is there to set the theme up; (init can be missing.) and
   the linktree sub template, which sorts out the link tree.

   The init sub template should load any data and set any hardcoded options.

   The main_above sub template is what is shown above the main content, and
   should contain anything that should be shown up there.

   The main_below sub template, conversely, is shown after the main content.
   It should probably contain the copyright statement and some other things.

   The linktree sub template should display the link tree, using the data
   in the $context['linktree'] variable.

   The menu sub template should display all the relevant buttons the user
   wants and or needs.

   For more information on the templating system, please see the site at:
   http://www.simplemachines.org/
*/

// Initialize the template... mainly little settings.
function template_init()
{
   global $context, $settings, $options, $txt;

   /* Use images from default theme when using templates from the default theme?
      if this is 'always', images from the default theme will be used.
      if this is 'defaults', images from the default theme will only be used with default templates.
      if this is 'never' or isn't set at all, images from the default theme will not be used. */
   $settings['use_default_images'] = 'never';

   /* What document type definition is being used? (for font size and other issues.)
      'xhtml' for an XHTML 1.0 document type definition.
      'html' for an HTML 4.01 document type definition. */
   $settings['doctype'] = 'xhtml';

   /* The version this template/theme is for.
      This should probably be the version of SMF it was created for. */
   $settings['theme_version'] = '1.1 RC2';

   /* Set a setting that tells the theme that it can render the tabs. */
   $settings['use_tabs'] = false;

   /* Use plain buttons - as oppossed to text buttons? */
   $settings['use_buttons'] = false;
   $settings['use_image_buttons'] = true;
   /* Show sticky and lock status seperate from topic icons? */
   $settings['seperate_sticky_lock'] = true;

   //load font style
   if (isset($_SESSION['font-style'])) {
      $options['fontstyle'] = $_SESSION['font-style'];
   } elseif (isset($_COOKIE['font-style'])) {
      $options['fontstyle'] = $_COOKIE['font-style'];
   }

   //load width style
   if (isset($_SESSION['width-style'])) {
      $options['widthstyle'] = $_SESSION['width-style'];
   } elseif (isset($_COOKIE['width-style'])) {
      $options['widthstyle'] = $_COOKIE['width-style'];
   }

   if (isset($_GET['widthstyle'])) {
      $options['widthstyle'] = $_GET['widthstyle'];
      $_SESSION['width-style'] = $options['widthstyle'];
      setcookie ('width-style', $options['widthstyle'], time()+31536000, '/', false);
   }
   if (isset($_GET['fontstyle'])) {
      $options['fontstyle'] = $_GET['fontstyle'];
      $_SESSION['font-style'] = $options['fontstyle'];
      setcookie ('font-style', $options['fontstyle'], time()+31536000, '/', false);
   }


}

// The main sub template above the content.
function template_main_above()
{
   global $context, $settings, $options, $scripturl, $txt, $modSettings;


   // test for joomla integration
   global $wrapped, $jsmfConfig, $header_style , $toolbar_style , $footer_style;

   if(isset($wrapped) && $wrapped==true)
      $context['joomla_wrapped']=true;
   elseif(isset($wrapped) && $wrapped==false)
      $context['joomla_wrapped']=false;
   elseif(isset($jsmfConfig) && $jsmfConfig->wrapped)
      $context['joomla_wrapped']=true;
   elseif(isset($jsmfConfig) && !$jsmfConfig->wrapped)
      $context['joomla_wrapped']=false;
   else
      $context['joomla_wrapped']=false;

   // Show right to left and the character set for ease of translating.
   echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"', $context['right_to_left'] ? ' dir="rtl"' : '', '><head>
   <meta http-equiv="Content-Type" content="text/html; charset=', $context['character_set'], '" />
   <meta name="description" content="', $context['page_title'], '" />
   <meta name="keywords" content="PHP, MySQL, bulletin, board, free, open, source, smf, simple, machines, forum" />
   <script language="JavaScript" type="text/javascript" src="', $settings['default_theme_url'], '/script.js?rc2p"></script>
   <script language="JavaScript" type="text/javascript">
      var smf_theme_url = "', $settings['theme_url'], '";
      var smf_images_url = "', $settings['images_url'], '";
      var smf_scripturl = "', $scripturl, '";
   </script>
   <title>', $context['page_title'], '</title>';

   // The ?rc2 part of this link is just here to make sure browsers don't cache it wrongly.

   if(!empty($options['fontstyle']))
      $fontstyle=$options['fontstyle'];
   else
      $fontstyle='f-default';

   if(!empty($options['widthstyle']))
      $widthstyle=$options['widthstyle'];
   else
      $widthstyle='w-wide';


      // the color choices
      if(!empty($settings['header_style']))
         $header_style=$settings['header_style'];
      else
         $header_style='dark';

      if(!empty($settings['toolbar_style']))
         $toolbar_style=$settings['toolbar_style'];
      else
         $toolbar_style='blue';

      if(!empty($settings['footer_style']))
         $footer_style=$settings['footer_style'];
      else
         $footer_style='dark';

       echo '
   <link rel="stylesheet" type="text/css" href="', $settings['theme_url'], '/css/template_css.css?rc2" />';

    if($context['browser']['is_ie'])
       echo '
   <link rel="stylesheet" type="text/css" href="', $settings['theme_url'], '/css/template_ie.css?rc2" />';

   echo '
   <link rel="stylesheet" type="text/css" href="', $settings['theme_url'], '/css/header_'.$header_style.'.css?rc2" />
   <link rel="stylesheet" type="text/css" href="', $settings['theme_url'], '/css/toolbar_'.$toolbar_style.'.css?rc2" />
   <link rel="stylesheet" type="text/css" href="', $settings['theme_url'], '/css/footer_'.$footer_style.'.css?rc2" />
   ';

 echo '
   <link rel="stylesheet" type="text/css" href="', $settings['theme_url'], '/style.css?rc2" />
   <link rel="stylesheet" type="text/css" href="', $settings['default_theme_url'], '/print.css?rc2" media="print" />';


   /* Internet Explorer 4/5 and Opera 6 just don't do font sizes properly. (they are big...)
      Thus, in Internet Explorer 4, 5, and Opera 6 this will show fonts one size smaller than usual.
      Note that this is affected by whether IE 6 is in standards compliance mode.. if not, it will also be big.
      Standards compliance mode happens when you use xhtml... */
   if ($context['browser']['needs_size_fix'])
      echo '
   <link rel="stylesheet" type="text/css" href="', $settings['default_theme_url'], '/fonts-compat.css" />';

   // Show all the relative links, such as help, search, contents, and the like.
   echo '
   <link rel="help" href="', $scripturl, '?action=help" target="_blank" />
   <link rel="search" href="' . $scripturl . '?action=search" />
   <link rel="contents" href="', $scripturl, '" />';

   // If RSS feeds are enabled, advertise the presence of one.
   if (!empty($modSettings['xmlnews_enable']))
      echo '
   <link rel="alternate" type="application/rss+xml" title="', $context['forum_name'], ' - RSS" href="', $scripturl, '?type=rss;action=.xml" />';

   // If we're viewing a topic, these should be the previous and next topics, respectively.
   if (!empty($context['current_topic']))
      echo '
   <link rel="prev" href="', $scripturl, '?topic=', $context['current_topic'], '.0;prev_next=prev" />
   <link rel="next" href="', $scripturl, '?topic=', $context['current_topic'], '.0;prev_next=next" />';

   // If we're in a board, or a topic for that matter, the index will be the board's index.
   if (!empty($context['current_board']))
      echo '
   <link rel="index" href="' . $scripturl . '?board=' . $context['current_board'] . '.0" />';

   // We'll have to use the cookie to remember the header...
   if ($context['user']['is_guest'])
      $options['collapse_header'] = !empty($_COOKIE['upshrink']);

   // Output any remaining HTML headers. (from mods, maybe?)
   echo $context['html_headers'], '

   <script language="JavaScript" type="text/javascript">
      var current_header = ', empty($options['collapse_header']) ? 'false' : 'true', ';

      function shrinkHeader(mode)
      {';

   // Guests don't have theme options!!
   if ($context['user']['is_guest'])
      echo '
         document.cookie = "upshrink=" + (mode ? 1 : 0);';
   else
      echo '
         smf_setThemeOption("collapse_header", mode ? 1 : 0, null, "', $context['session_id'], '");';

   echo '
         document.getElementById("upshrink").src = smf_images_url + (mode ? "/upshrink2.gif" : "/upshrink.gif");

         document.getElementById("upshrinkHeader").style.display = mode ? "none" : "";
         document.getElementById("upshrinkHeader2").style.display = mode ? "none" : "";

         current_header = mode;
      }
   </script>';

   // the routine for the info center upshrink
   echo '
      <script language="JavaScript" type="text/javascript">
         var current_header_ic = ', empty($options['collapse_header_ic']) ? 'false' : 'true', ';

         function shrinkHeaderIC(mode)
         {';

   if ($context['user']['is_guest'])
      echo '
            document.cookie = "upshrinkIC=" + (mode ? 1 : 0);';
   else
      echo '
            smf_setThemeOption("collapse_header_ic", mode ? 1 : 0, null, "', $context['session_id'], '");';

   echo '
            document.getElementById("upshrink_ic").src = smf_images_url + (mode ? "/expand.gif" : "/collapse.gif");

            document.getElementById("upshrinkHeaderIC").style.display = mode ? "none" : "";

            current_header_ic = mode;
         }
      </script>
</head>';

   if(!$context['joomla_wrapped']){
   echo '
<body id="page_bg" class="'.$widthstyle.' '.$fontstyle.' header-'.$header_style.' toolbar-'.$toolbar_style.' footer-'.$footer_style.'">
   <div id="header">
      <div class="wrapper">
         <div id="access">
            <div id="selectors">
               <span class="font-selector">&nbsp;</span>
               <span class="width-selector">&nbsp;</span>
            </div>
            <div id="buttons">
               <a href="',$scripturl,'?widthstyle=w-fluid" title="fluid width" class="fluid"><span class="button">&nbsp;</span></a>
               <a href="',$scripturl,'?widthstyle=w-wide" title="wide width" class="wide"><span class="button">&nbsp;</span></a>
               <a href="',$scripturl,'?widthstyle=w-thin" title="thin width" class="thin"><span class="button">&nbsp;</span></a>
               <a href="',$scripturl,'?fontstyle=f-larger" title="Increase size" class="lrg"><span class="button">&nbsp;</span></a>
               <a href="',$scripturl,'?fontstyle=f-default" title="Default size" class="med"><span class="button">&nbsp;</span></a>
               <a href="',$scripturl,'?fontstyle=f-smaller" title="Decrease size" class="sml"><span class="button">&nbsp;</span></a>
            </div>
         </div>
         <a href="'.$scripturl.'" title=""><span id="logo">&nbsp;</span></a>';
            // Show a random news item? (or you could pick one from news_lines...)
         if (!empty($settings['enable_news'])) {
            echo '<div id="top">', $context['random_news_line'] , '</div>';
            }
      echo '
      </div>
   </div>
   <div id="toolbar">
      <div class="wrapper">
         <div id="nav">',template_menu(),'
         </div>
      </div>
   </div>';
    echo '
  <div id="showcase">
     <div class="wrapper">
       <div class="padding">
          ' , leftmenu(), '
       </div>
      </div>
   </div>
    ';
    echo '
   <div id="mainbody">
      <div class="wrapper">
         <div id="mainbody-2">
            <div id="mainbody-3">
               <div id="mainbody-4">
                  <div id="mainbody-5">
                     <div id="mainbody-padding">
                        <table class="mainbody" cellspacing="0">
                           <tr>
                              <td valign="top" class="mainbody" id="mainmen">';
   }
  if ($context['joomla_wrapped'])
   echo '<div class="titlebg" style="overflow: hidden;"><div id="smf_menu">',template_menu2(),'</div></div>';

 }

function template_main_below()
{
   global $context, $settings, $options, $scripturl, $txt;
  if ($context['joomla_wrapped']) {
    echo'
         <div style="padding: 5px; text-align: center;">
            <div class="smalltext">' ,theme_copyright(),'<br />
               Original Joomla Template design by <a href="http://www.rockettheme.com">RocketTheme</a> (
               Conversion by <a href="http://www.tinyportal.net">Bloc</a>)
            </div></div>';
      }
   if(!$context['joomla_wrapped'])
      echo '
                      <br /><br />
                              </td>
                           </tr>
                        </table>
                     </div>
                  </div>
               </div>
            </div>
         </div>
      </div>
   </div>
  <div id="footer">
      <div class="wrapper">
         <div class="padding">
          <table class="footer" cellspacing="0">
               <tr valign="top">
                  <td class="footer">
                     <div class="moduletable center">
        ' ,theme_copyright(),'<br />
               Original Joomla Template design by <a href="http://www.rockettheme.com">RocketTheme</a> (
               Conversion by <a href="http://www.tinyportal.net">Bloc</a>)
              </div>
            </td>
          </tr>
        </table>

      </div>
    </div>
  </div>';


   echo '
</body></html>';
}

// Show a linktree. This is that thing that shows "My Community | General Category | General Discussion"..
function theme_linktree()
{
   global $context, $settings, $options;

   echo '<span class="pathway">';
   // Each tree item has a URL and name. Some may have extra_before and extra_after.
   foreach ($context['linktree'] as $link_num => $tree)
   {
      // Show something before the link?
      if (isset($tree['extra_before']))
         echo $tree['extra_before'];

      // Don't show a separator for the last one.
      if ($link_num != count($context['linktree']) - 1)
         // Show the link, including a URL if it should have one.
         echo $settings['linktree_link'] && isset($tree['url']) ? '<a href="' . $tree['url'] . '" class="pathway">' . $tree['name'] . '</a>' : $tree['name'] , '<img src="'.$settings['images_url'].'/arrow.png" style="margin: 0 12px 0 12px" alt="" />';
      else
         echo $tree['name'];

      // Show something after the link...?
      if (isset($tree['extra_after']))
         echo $tree['extra_after'];

   }

   echo '</span>';
}

// Show the menu up top. Something like [home] [help] [profile] [logout]...
function template_menu()
{
   global $context, $settings, $options, $scripturl, $txt;


   echo '
   <ul>';


   // Show the [home] button.
   echo   '<li><a href="', $scripturl, '">' , $txt[103] , '</a></li>';

   // Show the [help] button.
   echo   '<li><a href="', $scripturl, '?action=help">' , $txt[119] , '</a></li>';

   // How about the [search] button?
   if ($context['allow_search'])
      echo '<li><a href="', $scripturl, '?action=search">' , $txt[182] , '</a></li>';

   // Is the user allowed to administrate at all? ([admin])
   if ($context['allow_admin'])
      echo   '<li><a href="', $scripturl, '?action=admin">' , $txt[2] , '</a></li>';

   // Edit Profile... [profile]
   if ($context['allow_edit_profile'])
      echo '<li><a href="', $scripturl, '?action=profile">' , $txt[79] , '</a></li>';

   // Go to PM center... [pm]
   if ($context['user']['is_logged'] && $context['allow_pm'])
      echo '<li><a href="', $scripturl, '?action=pm">' , $txt['pm_short'] , ' ', $context['user']['unread_messages'] > 0 ? '[<strong>'. $context['user']['unread_messages'] . '</strong>]' : '' , '</a></li>';


   // The [calendar]!
   if ($context['allow_calendar'])
      echo '<li><a href="', $scripturl, '?action=calendar">' , $txt['calendar24'] , '</a></li>';

   // the [member] list button
   if ($context['allow_memberlist'])
      echo '<li><a href="', $scripturl, '?action=mlist">' , $txt[331] , '</a></li>';


   // If the user is a guest, show [login] button.
   if ($context['user']['is_guest'])
      echo '<li><a href="', $scripturl, '?action=login">' , $txt[34] , '</a></li>';


   // If the user is a guest, also show [register] button.
   if ($context['user']['is_guest'])
      echo '<li><a href="', $scripturl, '?action=join">' , $txt[97] , '</a></li>';


   // Otherwise, they might want to [logout]...
   if ($context['user']['is_logged'])
      echo '<li><a href="', $scripturl, '?action=logout;sesc=', $context['session_id'], '">' , $txt[108] , '</a></li>';

   echo '</ul>';


}
// Show the menu up top. Something like [home] [help] [profile] [logout]...
function template_menu2()
{
   global $context, $settings, $options, $scripturl, $txt;


   echo '
   <ul>';


   // Show the [home] button.
   echo   '<li><a href="', $scripturl, '">' , $txt[103] , ' | </a></li>';

   // Show the [help] button.
   echo   '<li><a href="', $scripturl, '?action=help">' , $txt[119] , ' | </a></li>';

   // How about the [search] button?
   if ($context['allow_search'])
      echo '<li><a href="', $scripturl, '?action=search">' , $txt[182] , ' | </a></li>';

   // Is the user allowed to administrate at all? ([admin])
   if ($context['allow_admin'])
      echo   '<li><a href="', $scripturl, '?action=admin">' , $txt[2] , ' | </a></li>';

   // Edit Profile... [profile]
   if ($context['allow_edit_profile'])
      echo '<li><a href="', $scripturl, '?action=profile">' , $txt[79] , ' | </a></li>';

   // Go to PM center... [pm]
   if ($context['user']['is_logged'] && $context['allow_pm'])
      echo '<li><a href="', $scripturl, '?action=pm">' , $txt['pm_short'] , ' ', $context['user']['unread_messages'] > 0 ? '[<strong>'. $context['user']['unread_messages'] . '</strong>]' : '' , ' | </a></li>';


   // The [calendar]!
   if ($context['allow_calendar'])
      echo '<li><a href="', $scripturl, '?action=calendar">' , $txt['calendar24'] , ' | </a></li>';

   // the [member] list button
   if ($context['allow_memberlist'])
      echo '<li><a href="', $scripturl, '?action=mlist">' , $txt[331] , ' | </a></li>';


   // If the user is a guest, show [login] button.
   if ($context['user']['is_guest'])
      echo '<li><a href="', $scripturl, '?action=login">' , $txt[34] , ' | </a></li>';


   // If the user is a guest, also show [register] button.
   if ($context['user']['is_guest'])
      echo '<li><a href="', $scripturl, '?action=join">' , $txt[97] , ' </a></li>';


   // Otherwise, they might want to [logout]...
   if ($context['user']['is_logged'])
      echo '<li><a href="', $scripturl, '?action=logout;sesc=', $context['session_id'], '">' , $txt[108] , '</a></li>';

   echo '</ul>';


}

// Generate a strip of buttons.
function template_button_strip($button_strip, $direction = 'top', $force_reset = false, $custom_td = '')
{
   global $settings, $buttons, $context, $txt, $scripturl;

   // Create the buttons...
   foreach ($button_strip as $key => $value)
   {
      if (isset($value['test']) && empty($context[$value['test']]))
      {
         unset($button_strip[$key]);
         continue;
      }
      elseif (!isset($buttons[$key]) || $force_reset)
         $buttons[$key] = '<a href="' . $value['url'] . '" ' .( isset($value['custom']) ? $value['custom'] : '') . '>' . $txt[$value['text']] . '</a>';

      $button_strip[$key] = $buttons[$key];
   }

   if (empty($button_strip))
      return '<td>&nbsp;</td>';

   echo '
      <td class="', $direction == 'top' ? 'main' : 'mirror', 'tab_' , $context['right_to_left'] ? 'last' : 'first' , '">&nbsp;</td>
      <td class="', $direction == 'top' ? 'main' : 'mirror', 'tab_back">', implode(' &nbsp;|&nbsp; ', $button_strip) , '</td>
      <td class="', $direction == 'top' ? 'main' : 'mirror', 'tab_' , $context['right_to_left'] ? 'first' : 'last' , '">&nbsp;</td>';
}
// Generate a strip of buttons.
function template_button_strip_mill($button_strip, $direction = 'top', $force_reset = false, $custom_td = '')
{
   global $settings, $buttons, $context, $txt, $scripturl;

   // Create the buttons...
   foreach ($button_strip as $key => $value)
   {
      if (isset($value['test']) && empty($context[$value['test']]))
      {
         unset($button_strip[$key]);
         continue;
      }
      elseif (!isset($buttons[$key]) || $force_reset)
         $buttons[$key] = '<a href="' . $value['url'] . '" ' .( isset($value['custom']) ? $value['custom'] : '') . '>'. ($custom_td!='' ? '<'.$custom_td.'>' : '') . $txt[$value['text']] . ($custom_td!='' ? '</'.$custom_td.'>' : '') .'</a>';

      $button_strip[$key] = $buttons[$key];
   }

   if (empty($button_strip))
      return '&nbsp;';

   echo implode(' &nbsp;|&nbsp; ', $button_strip);
}
function leftmenu()
{
   global $settings, $buttons, $context, $txt, $scripturl;
   // personal info etc.
   echo '<table class="showcase" cellspacing="0">
               <tr valign="top">';

   echo '
            <td class="showcase">
               <div class="moduletable">';

   if (!empty($context['user']['avatar']))
      echo '<div class="avatar">', $context['user']['avatar']['image'], '</div><div class="profile_info">';

   // If the user is logged in, display stuff like their name, new messages, etc.
   if ($context['user']['is_logged'])
   {
      echo '<h3>', $txt['hello_member_ndt'], ' <b>', $context['user']['name'], '</b></h3>';

      echo '<ul id="useropts">';
      // Only tell them about their messages if they can read their messages!
      if ($context['allow_pm'])
         echo '<li>', $txt[152], ' <a href="', $scripturl, '?action=pm">', $context['user']['messages'], ' ', $context['user']['messages'] != 1 ? $txt[153] : $txt[471], '</a> ', $context['user']['unread_messages'], ' ', $context['user']['unread_messages'] == 1 ? $txt['newmessages0'] : $txt['newmessages1'];
      echo '.</li>';

      // Is the forum in maintenance mode?
      if ($context['in_maintenance'] && $context['user']['is_admin'])
         echo '<li><b>', $txt[616], '</b></li>';

      // Are there any members waiting for approval?
      if (!empty($context['unapproved_members']))
         echo '<li>', $context['unapproved_members'] == 1 ? $txt['approve_thereis'] : $txt['approve_thereare'], ' <a href="', $scripturl, '?action=viewmembers;sa=browse;type=approve">', $context['unapproved_members'] == 1 ? $txt['approve_member'] : $context['unapproved_members'] . ' ' . $txt['approve_members'], '</a> ', $txt['approve_members_waiting'], '</li>';

      // Show the total time logged in?
      if (!empty($context['user']['total_time_logged_in']))
      {
         echo '<li>
                     ', $txt['totalTimeLogged1'];

         // If days is just zero, don't bother to show it.
         if ($context['user']['total_time_logged_in']['days'] > 0)
            echo $context['user']['total_time_logged_in']['days'] . $txt['totalTimeLogged2'];

         // Same with hours - only show it if it's above zero.
         if ($context['user']['total_time_logged_in']['hours'] > 0)
            echo $context['user']['total_time_logged_in']['hours'] . $txt['totalTimeLogged3'];

         // But, let's always show minutes - Time wasted here: 0 minutes ;).
         echo $context['user']['total_time_logged_in']['minutes'], $txt['totalTimeLogged4'], '</li>';
      }

      echo '<li><a href="', $scripturl, '?action=unread">', $txt['unread_since_visit'], '</a></li>
               <li><a href="', $scripturl, '?action=unreadreplies">', $txt['show_unread_replies'], '</a></li>
               <li>', $context['current_time'],'</li>
           </ul>
        </div>
      </td>';
   }
   // Otherwise they're a guest - so politely ask them to register or login.
   else
   {
      echo '
                     ', $txt['welcome_guest'], '
                     <script language="JavaScript" type="text/javascript" src="', $settings['default_theme_url'], '/sha1.js"></script>

                     <form action="', $scripturl, '?action=login2" method="post" style="margin: 4px 0;"', empty($context['disable_login_hashing']) ? ' onsubmit="hashLoginPassword(this, \'' . $context['session_id'] . '\');"' : '', '>
                           <input type="text" name="user" style="margin-bottom: 4px;" size="10" />
                           <input type="password" name="passwrd" style="margin-bottom: 4px;" size="10" /><br />
                           <select name="cookielength">
                              <option value="60">', $txt['smf53'], '</option>
                              <option value="1440">', $txt['smf47'], '</option>
                              <option value="10080">', $txt['smf48'], '</option>
                              <option value="302400">', $txt['smf49'], '</option>
                              <option value="-1" selected="selected">', $txt['smf50'], '</option>
                           </select>
                           <input type="submit" value="', $txt[34], '" />

                           <input type="hidden" name="hash_passwrd" value="" />
               </form>', $txt['smf52'], '<br /><br />';
   }
   if (!empty($context['user']['avatar'])) {
    echo '  </div>';
  }

  echo '   </div>
        </td>';

   echo '
           <td class="showcase">
            <div class="moduletable">
               <form action="', $scripturl, '?action=search2" method="post" style="margin: 4px 0;">
                     <input type="text" name="search" value="" size="30" style="margin-bottom: 4px;"  />&nbsp;
                     <input type="submit" name="submit" value="', $txt[182], '" style="margin-bottom: 4px;"  /><br />
                     <a href="', $scripturl, '?action=search;advanced">', $txt['smf298'], '</a>
                     <input type="hidden" name="advanced" value="0" />
               ';

   // Search within current topic?
   if (!empty($context['current_topic']))
      echo '
                     <input type="hidden" name="topic" value="', $context['current_topic'], '" />';

      // If we're on a certain board, limit it to this board ;).
   elseif (!empty($context['current_board']))
      echo '
                     <input type="hidden" name="brd[', $context['current_board'], ']" value="', $context['current_board'], '" />';

   echo '
               </form><br />
               <b>', $context['common_stats']['total_posts'], '</b> ', $txt[95], ' ', $txt['smf88'], ' <b>', $context['common_stats']['total_topics'], '</b> ', $txt[64], '- ', $txt[525], ' <span style="white-space: nowrap;"><b>', $context['common_stats']['total_members'], '</b> ', $txt[19], '</span> -
                     ', $txt[656], ': <b> ', $context['common_stats']['latest_member']['link'], '</b>
      </div>
    </td>';
  echo '
        </tr>
      </table>';
}

?>

Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: newton on July 06, 2007, 05:53:07 am
Hi,
I've recently installed Enterprise_smf11final_tp theme... (with TP 0.97)
I get a problem whenever i add the custom ads script.
Ive attached the whole theme to this post. I only think that the index.template.php file needs modifying... but i cant get it to work.
Any help is appreciated,
Thanks in advance,
Regards,
Newton
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: newton on July 08, 2007, 09:25:40 am
Hi,
Ive analysed the problem ... and it seems the ads which appear on top of the page are overlapped by the header. How can I change the script so that the ads can be changed position to the right.
Thanks,
Newton

ps... you may see the problem on my webpage after changing the theme to enterprise:
http://www.runescape.heliohost.org
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: bigguy on July 18, 2007, 05:32:57 pm
I am not to sure how to do that. Try placing the ad code somewhere else in the template file. You really need a good editor when you do coding, do you have one. ???
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: edgehead on August 20, 2007, 04:38:57 pm
THANK YA SIR.. HEHE
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: Tatore on September 02, 2007, 01:52:08 pm
Hi, bigguy.
I've installed several times your index.template.
But with this theme it seems a challenge:
I'll attach it
One is modified, the other one is clean.
The other template files look good.
Let me know.
Thank you
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: Nena on September 09, 2007, 09:39:39 pm
I cannot get my ads to show w/in the posts ... I have followed the directions and kept getting phase errors when trying to open posts so i put it back to my IG-OH theme default for the display file.

I also cannot find the
Code: [Select]
</td></tr>';
}

tags, I found 2 or 3 sets of them but none with the } on the next like like that, its either 2 lines down or they are all on separate lines.

My board is www.corsotalk.com the ads on the top and bottom work well, however the ads on the welcome info do are all funny and vertical but its mainly the ones w/in the posts now that I would like to have showing.... and perhaps the ones inbetween the boards would be great too.

thanks in advance.
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: Grimjack on November 15, 2007, 03:17:39 pm
Ok I am super newbie to simple machines, and I have figured out that the reason why Admag is not working for my site is because I use the Babylon theme.

Now with this thread I have to go in an edit code.  I don't mind that, but where do I begin?

We had our SMF was provided to us and we just manage it, so I need to learn how I get into the code it self.

Do I do it from SMF, or do I need a 3rd party web editor, or what?

Please help.

Thank you,
Anthony
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: happygolucky on November 16, 2007, 01:11:42 pm
Configuration link not showing in admin window. It has a space that has opened for it but no link or text.
I am using the Classic theme.
Can you tell me what to do about this? I have done all the edits.

Thanks
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: the4em.com on November 17, 2007, 11:56:40 pm
Hello,

I am using Silver Blaze template and it shows me the following error when I try to see any thread :

Code: [Select]
Template Parse Error!
It seems something has gone sour on the forum with the template system. This problem should only be temporary, so please come back later and try again. If you continue to see this message, please contact the administrator.

You can also try refreshing this page.

I attached the modified files, please let me know which file or where I make mistake?  :-\ :'(
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: the4em.com on November 20, 2007, 05:48:24 am
I am still waiting for your reply, please help.  :(
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: frosted on April 01, 2008, 07:29:26 pm
im useing the AA new damage theme from webtechnica

maybe its my server host or i suck with php but after i made the changes no theme showed up on the forums it was jsut text no graphics

i was planning on useing the ad mod for cycleing ads and banners so if u have ne advice please share
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: rudrawadi on June 22, 2008, 07:13:02 am
i cant edit ds-natural theme in dzinerstudio.com can any one help me
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: fishy on August 05, 2008, 03:10:35 am
Hi,
I have tried to install this ad mod onto Sunset theme by Mustang forum. Powered by SMF 2.0 Beta 3.1

I cannot get this working and i have been trying for weeks, can anyone help?
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: blackmask1 on August 11, 2008, 02:27:25 pm
Hello friends

I am using theme orange-lt115v1 and my forum version is 1.1.5.

I have been using add mod but my site didn't display adds in this theme. It displays add in default theme but not in this theme...please help.

I have attached the theme file. Please make the modification on the attached theme file and upload it again for my help..
thank
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: Th3On3 on August 15, 2008, 12:20:54 pm
Hi, Im using a custom theme (Basic by Crip) http://custom.simplemachines.org/themes/index.php?lemma=752

And i want to Install The SMF Ads Mod

My website link is here:
http://www.l2-element.com/forum/index.php

But when i try to install this mod it doesn't work on my custom theme, Any Help?
I tried to Install it manually But the Custom Theme doesn't Come with Display.template.php . Does Anyone Know what to do?

Thanks for the Help,
Staunton
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: bigguy on August 29, 2008, 09:25:56 pm
Are you really using this verfsion of the mod. ??? You should beusing the up to date one.
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: MinisterPhobia on September 16, 2008, 03:44:40 pm
I started following this guide and immediately got errors...

Quote
Template Parse Error!
There was a problem loading the /Themes/Dark-TURK/index.template.php template or language file. Please check the syntax and try again - remember, single quotes (') often have to be escaped with a slash (\). To see more specific error information from PHP, try accessing the file directly.

You may want to try to refresh this page or use the default theme.

Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in .../Themes/Dark-TURK/index.template.php on line 176

167:             current_header_ic = mode;
168:          }
169:       // ]]></script>
170: </head>
171: <body>
172:
173:    //Display ads on the top of the page
174:    $ads = show_topofpageAds();   
175:    if(!empty($ads))

176:       if($ads['type']==0)

177:          echo $ads['content'];
178:       else
179:          eval($ads['content']);   
180:    unset($ads);


Any ideas?
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: ccbtimewiz on September 16, 2008, 05:01:40 pm
Find:
Code: [Select]
<body>
Replace with:
Code: [Select]
<body>';
Find:
Code: [Select]
unset($ads);
Replace with:
Code: [Select]
unset($ads);

echo '
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: MinisterPhobia on September 16, 2008, 05:55:46 pm
I take it that I'm gonna have to do that for all of the edits?
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: mostwanted1 on September 28, 2008, 11:37:31 am
I have tried now 4 times already and I still can not get this to work for my site..
I had it working with the default theme very well and decided to change the theme, I have got most of my mods to work now with the exception of this one..


Attached is a slightly modded helios_multi11final and I can not get it to work for the life of me...

Would you be so kind to help me out with this, I would greatly appreciate it! :)

I am currently running     2.3
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: aZa on October 05, 2008, 12:44:25 pm
hey!!!

Firstly thanx for this wonderful mod. This works perfectly on the default theme, but i want it to run as good on SAF MULTI COLOR theme. I have tried using the PARSER and edited the template files but i get an template parser error.


Has anyone implemented this on SAF MULTICOLOR theme ?

please help this is urgent.

regards
SyD
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: aZa on October 05, 2008, 12:49:46 pm
Just searched and found some modded files by bigguy!

Thanx man!

cheers
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: aZa on October 06, 2008, 01:12:12 pm
ok i installed the files provided in of the other threads for SAF theme.

SAD it dont work... i applied the mods then using a parser and also checking with the modded files. But i still got a Template parser error


I'm attaching the 4 required files !

please help i'm at my wits end with this

i'm using SMF 1.1.6
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: aZa on October 12, 2008, 03:28:55 am
hello pls help?
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: lschafroth on October 16, 2008, 10:08:16 pm
Can someone upload or email me the edited files for the babylon theme? I am using 1.1.6 with a fresh install and this mod.  I can get the default and classic to work but for some reason I cannot get babylong to work.

I get the following error:

Template Parse Error!
There was a problem loading the F:\domains\Reseller\iowarctracks\iowarctracks.com\www/Themes/babylon/Display.template.php template or language file. Please check the syntax and try again - remember, single quotes (') often have to be escaped with a slash (\). To see more specific error information from PHP, try accessing the file directly.


My email is lannie at schafroth dot name

.name

Lannie
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: aZa on October 18, 2008, 04:11:10 am
Still waiting for some help with the saf multicolor theme
Title: Re: Edits for ad_mod_rc2_v2 for themes other than default
Post by: ccbtimewiz on October 22, 2008, 07:55:39 pm
Old post is old.

Locked.