Author Topic: Edits for ad_mod_rc2_v2 for themes other than default  (Read 4786 times)

0 Members and 1 Guest are viewing this topic.

Offline bigguy

  • Site Owner
  • Administrator
  • *
  • Posts: 13217
  • Karma: 269
  • Gender: Male
  • Get'r Done
    • P.C. Tweakr
  • SMF Version: 2.0 Gold
Edits for ad_mod_rc2_v2 for themes other than default
« on: February 17, 2008, 01:52:30 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:

:
<body>';
After that line add:

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

:
                            </td>
BEFORE that add:

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

:
    template_menu();
Then add BEFORE:

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

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

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

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

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

:
global $context, $settings, $options, $txt, $scripturl, $modSettings;
BEFORE that add:

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

:
    // Get all the messages...
And REPLACE with:

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

In the same file find:

:
    </td></tr>';
    }

And REPLACE with:

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

:
global $context, $settings, $options, $scripturl, $modSettings, $txt;
BEFORE that add:

:
    //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.
« Last Edit: October 22, 2008, 06:58:49 AM by Smoky »

Offline kisuke

  • New Member
  • *
  • Posts: 2
  • Karma: 2
  • Gender: Male
    • WoW Sentient
  • SMF Version: 1.1.6
Re: Edits for ad_mod_rc2_v2 for themes other than default
« Reply #1 on: September 20, 2008, 02:58:08 PM »
in index.template.php I couldn't find     template_menu(); is that bad?

Offline Smoky

  • who, me?
  • Guru
  • *
  • Posts: 3980
  • Karma: 1450
  • Gender: Female
  • It's all in your HEAD!
    • HangOutSpot
  • SMF Version: 2.0 ??
Re: Edits for ad_mod_rc2_v2 for themes other than default
« Reply #2 on: September 20, 2008, 03:30:41 PM »
are you using notepad++ ?

it is a free ware text editor that works great.. has built in serach using cntrl and "f".. 

the "template_menu();" is your menu and you should be able to find it somewhere one your theme..
Oh wow, guess who dropped by! Im still on secondlife.. but will respond to im's *waves

Offline gstek

  • New Member
  • *
  • Posts: 57
  • Karma: 104
  • Gender: Male
  • hac_king realm
    • hac_king realm
  • SMF Version: 2.0 beta RC1
Re: Edits for ad_mod_rc2_v2 for themes other than default
« Reply #3 on: October 05, 2008, 10:42:02 PM »
Thanx alot bigguy for this , i am using Clanwar as my theme [ do you think its good theme to be used forever ?] and i already edited all this according to my needs but still your post will help me do it in a systamtic manner.

Offline bigguy

  • Site Owner
  • Administrator
  • *
  • Posts: 13217
  • Karma: 269
  • Gender: Male
  • Get'r Done
    • P.C. Tweakr
  • SMF Version: 2.0 Gold
Re: Edits for ad_mod_rc2_v2 for themes other than default
« Reply #4 on: October 05, 2008, 11:12:07 PM »
Not a problem, glad you found it useful. If the theme stays up to date then I say keep it going. ;)

Offline gstek

  • New Member
  • *
  • Posts: 57
  • Karma: 104
  • Gender: Male
  • hac_king realm
    • hac_king realm
  • SMF Version: 2.0 beta RC1
Re: Edits for ad_mod_rc2_v2 for themes other than default
« Reply #5 on: October 06, 2008, 10:49:16 AM »
Now i need you help for modding Display.template file of CLANWAR theme for admod :(
i am really got messed up with these? i am not able to understand that what to do and where to do? its diff from Index.template...

I am attaching both files i.e. Clan war dispalytemplate and default theme
 displaytemplate along with admod version i installed ( to see from packge parser ) :)

Please someone please modify my CLANWAR display.template according to the Default theme Dispaly.template ( both templates are admod installed but clanwar doesnt have all the codes )

This help would be higly appreciated :) :awe :righton

Waiting :)
« Last Edit: October 16, 2008, 01:42:41 PM by bigguy »

Offline bigguy

  • Site Owner
  • Administrator
  • *
  • Posts: 13217
  • Karma: 269
  • Gender: Male
  • Get'r Done
    • P.C. Tweakr
  • SMF Version: 2.0 Gold
Re: Edits for ad_mod_rc2_v2 for themes other than default
« Reply #6 on: October 06, 2008, 10:54:49 AM »
I have to go out soon but when I get back if no one has looked at it I will.

Offline gstek

  • New Member
  • *
  • Posts: 57
  • Karma: 104
  • Gender: Male
  • hac_king realm
    • hac_king realm
  • SMF Version: 2.0 beta RC1
Re: Edits for ad_mod_rc2_v2 for themes other than default
« Reply #7 on: October 10, 2008, 12:30:42 PM »
I think no one is interested in Real support ???

Offline brianjw

  • Guru
  • *
  • Posts: 2346
  • Karma: 1408
  • Gender: Male
  • What?!?! You mean they're sold out!
Re: Edits for ad_mod_rc2_v2 for themes other than default
« Reply #8 on: October 10, 2008, 04:11:47 PM »
Please have some patience gstek... Bigguy and I are both very busy these past days. We're sorry about that, but real life really comes first. ;)

Us editing these files for you is also a privilege. We have the edits posted and we could just say figure it out like some forums do. We actually like to get into the file for you. ;)

Offline Smoky

  • who, me?
  • Guru
  • *
  • Posts: 3980
  • Karma: 1450
  • Gender: Female
  • It's all in your HEAD!
    • HangOutSpot
  • SMF Version: 2.0 ??
Re: Edits for ad_mod_rc2_v2 for themes other than default
« Reply #9 on: October 10, 2008, 05:00:09 PM »
and i have been slamed as well  gstek.

if you want to take a chance, and try to learn a bit, read this post here, and it will show you how to add a mod.. this is what i learned off of.. ;)

http://www.smfhelper.info/forum/index.php/topic,590.0.html
Oh wow, guess who dropped by! Im still on secondlife.. but will respond to im's *waves

Offline gstek

  • New Member
  • *
  • Posts: 57
  • Karma: 104
  • Gender: Male
  • hac_king realm
    • hac_king realm
  • SMF Version: 2.0 beta RC1
Re: Edits for ad_mod_rc2_v2 for themes other than default
« Reply #10 on: October 11, 2008, 02:36:08 AM »
@smoky and brinjaw ... BRO i posted that reply after waiting FOUR [ 4 days ]
so i dont think i was impatient ?? overall why i got frustrated that nobody
from lots of experts didnt devoted a Click to download my files :(

BDW i already tried looking into files myuself but edits of display template is out of my
perspective.

[ Overall my splitting topic problem is still unsolved whereas i did all that what you
suggested ] :(

Offline bigguy

  • Site Owner
  • Administrator
  • *
  • Posts: 13217
  • Karma: 269
  • Gender: Male
  • Get'r Done
    • P.C. Tweakr
  • SMF Version: 2.0 Gold
Re: Edits for ad_mod_rc2_v2 for themes other than default
« Reply #11 on: October 11, 2008, 12:07:43 PM »
I think one of the other reasons that no one has downloaded your files other than being busy is we are also here to teach; not just do all the edits for you and then be done with it. There is an old saying:

"Catch a fish for a person and you feed him for one day. Teach him to fish and you will feed him for the rest of his life."

Which person would you like to be. :) All you need is a good editor and to read that post that Smoky posted and try. If then you get stuck I really have no problems helping out. As Brian has said though we all have been a bit busy lately and I am sorry for the wait. :)
« Last Edit: October 11, 2008, 09:38:41 PM by bigguy »

Offline brianjw

  • Guru
  • *
  • Posts: 2346
  • Karma: 1408
  • Gender: Male
  • What?!?! You mean they're sold out!
Re: Edits for ad_mod_rc2_v2 for themes other than default
« Reply #12 on: October 11, 2008, 09:37:04 PM »
Also, while looking through the code.. if you can't find a whole bit of code then look for a small part of the code. It might conflict with other mods, but if you search for smaller parts inside of the code, then it may find it. ;)

Offline gstek

  • New Member
  • *
  • Posts: 57
  • Karma: 104
  • Gender: Male
  • hac_king realm
    • hac_king realm
  • SMF Version: 2.0 beta RC1
Re: Edits for ad_mod_rc2_v2 for themes other than default
« Reply #13 on: October 15, 2008, 02:15:23 AM »
I think one of the other reasons that no one has downloaded your files other than being busy is we are also here to teach; not just do all the edits for you and then be done with it. There is an old saying:

"Catch a fish for a person and you feed him for one day. Teach him to fish and you will feed him for the rest of his life."


Bro i myself Owning a forum of 1750 members :) so i know this thing far better than you
but sometimes its not feasible for someone to learn at first,, experinced person should
do such thing few times for him then make him to learn from it.

as in my case you peoples taking me as a complete noob but i am very quick learner.
Considering programing is not my field and thing of interest but still i know alot
but NOT THAT MUCH.

I already tried it myself and yes brinjaw i know this thing that we have to look for
a part of code coz its obvious that installer failed to do auto install because
 code is changed due to diff theme or due to any other mod.


reason that i asked from you do it coz i am getting PHP error while editing it
[ my manual editing is absolutely right but its creating something "" }  ""
in last and i am not that much techy guy in php ]
:
echo '
  // ]]></script>';
 }
 
 ?>

} this creating problem in display template and i am getting template parsing error
due to some T character etc.... and when i removes } then page loads but evrything on page
gets distracted , fonts gets bigger, logo slides to down ... and a text named " PAGE:" appears in top.
[ but ad mod gets installed properly ]

if you peoples are still busy or have excuses after 10 days then i think i have look
somewhere else
???
« Last Edit: October 15, 2008, 02:22:03 AM by gstek »

Offline bigguy

  • Site Owner
  • Administrator
  • *
  • Posts: 13217
  • Karma: 269
  • Gender: Male
  • Get'r Done
    • P.C. Tweakr
  • SMF Version: 2.0 Gold
Re: Edits for ad_mod_rc2_v2 for themes other than default
« Reply #14 on: October 15, 2008, 08:12:26 AM »
I have to go out this morning but I will help when I get back if I can. Have you tried adding this to the end of the {

:
';