Coinbase

Author Topic: Custom Coding for Wow-Dk Theme  (Read 4860 times)

0 Members and 1 Guest are viewing this topic.

Offline daryllau

  • Newbie
  • *
  • Posts: 3
Custom Coding for Wow-Dk Theme
« on: May 28, 2007, 11:36:34 am »
Dear BigGuy... here are the files as per your request but I'm afraid I've installed WoW-Itemstats mod already besides the recent Ads Management.

Thanks once again for everything!

Warm regards,
Daryl

Offline bigguy

  • Support
  • Elite Member
  • *
  • Posts: 1518
    • SMF Helper
Re: Custom Coding for Wow-Dk Theme
« Reply #1 on: May 28, 2007, 06:00:44 pm »
Ok, i will get to this tonight if I can.

Offline daryllau

  • Newbie
  • *
  • Posts: 3
Re: Custom Coding for Wow-Dk Theme
« Reply #2 on: May 29, 2007, 04:53:56 pm »
Looking forward to it bud... thanks again!

Offline bigguy

  • Support
  • Elite Member
  • *
  • Posts: 1518
    • SMF Helper
Re: Custom Coding for Wow-Dk Theme
« Reply #3 on: June 12, 2007, 05:02:58 pm »
I could not get the:

//Display Ads on the Message index

code to go in but it should all work. Backup before trying by renaming the originals and replacing them with these, ONE AT A TIME. Just in case there are errors, this way is better so I know what file does not work.
Are there any mods installed on your forum ??? I would like to use these files for other ppl if they work.

Offline whatchamccallum

  • Newbie
  • *
  • Posts: 9
Re: Custom Coding for Wow-Dk Theme
« Reply #4 on: June 17, 2007, 11:28:08 am »
Just so you know they did seem to work. However the User Logon area seemed to be something that you hard coded and not what I had set as an add. Not sure what that was all about..

I use Tiny Portal so these edits don't work for me but I thought I would let you know...

Is anyone working on Tiny Portal themes to incorporate the admod to save me time?

Offline whatchamccallum

  • Newbie
  • *
  • Posts: 9
Re: Custom Coding for Wow-Dk Theme
« Reply #5 on: June 17, 2007, 11:29:54 am »
and as a good little forum junkie I just did a seach and found some comments on Tiny Portal so off to reading I go   ;D

Offline daryllau

  • Newbie
  • *
  • Posts: 3
Re: Custom Coding for Wow-Dk Theme
« Reply #6 on: June 17, 2007, 05:08:11 pm »
Hi BigGuy... unfortunately it doesn't seem to work for me. The messages does not appear and there is no Ads management link on my admin page. Can you so kindly share with me how to go about it?

Thanks for all your efforts and assistance.

Warmest regards,
Daryl

Offline whatchamccallum

  • Newbie
  • *
  • Posts: 9
Re: Custom Coding for Wow-Dk Theme
« Reply #7 on: June 17, 2007, 09:11:24 pm »
First thing I did was to make sure that I had the adsmod working with the SMF Default Theme first. This includes the admin link. I just simply added the adsmod to the SMF packages and did the install. After that I then installed the wow-dk theme on my site (non modified) and replaced the 4 files above.

He did state that he wasn't able to get the Display Ads on the Message index working.

I'm trying to mess with the messages index code right now to see if I can figure it out. Mine isn't very sharable cause I'm using several other addons on my site that make my template files kind of templess.  :D

Offline whatchamccallum

  • Newbie
  • *
  • Posts: 9
Re: Custom Coding for Wow-Dk Theme
« Reply #8 on: June 18, 2007, 01:11:48 am »
Sorry that I don't have time to go through the whole theme again without addons and such for you but I thought I would share what I did to get the Display.template.php modifications done to show the ads in between posts.

starting at line 8 right after the global variable declarations I added (this is the same as mentioned in other forum posts)
Code: [Select]
//Display ads on the thread page
if (function_exists("show_threadAds"))
{
$ads = show_threadAds();
if(!empty($ads))
if($ads['type']==0)
echo $ads['content'];
else
eval($ads['content']);
unset($ads);
}

Now if I didn't good to much up line 306 is    // Get all the messages... for you.
From line 306 to line 314 make changes so the code reads
Code: [Select]
//Ad Counter
$adcounter = 0;
// Get all the messages...

  while ($message = $context['get_message']())
  {
  $adcounter++;
    if (empty($settings['user_info_position']))
    {
The last two lines there are unchanged original code so you can find your placement

The If statement there about the user_info_position opens two separate ways a post can be displayed. To keep the ads integrated into the themes as much as possible I added the same code at the end of the if and at the end of the else statement, both times right after the signature..

I included the signature code so you know where I added in the Ads mod edit.
Code: [Select]
    // Show the member's signature?
    if (!empty($message['member']['signature']) && empty($options['show_no_signatures']))
    echo '
    <hr width="100%" size="0" style="border-top:1px solid #e1dfe1;" />
    <div class="signature">', $message['member']['signature'], '</div>';
 
          // ADS
        if (function_exists("show_posts"))
    {
    if ($adpost = show_posts($adcounter))
    {
    if($modSettings['ads_lookLikePosts'])
    {
    echo '
   
    <tr><td style="padding: 1px 1px 0 1px;">
    <table width="100%" cellpadding="3" cellspacing="0" border="0">
    <tr><td class="windowbg3">
    <table width="100%" cellpadding="5" cellspacing="0" style="table-layout: fixed;">
    <tr>
    <td valign="top" width="16%" rowspan="2" style="overflow: hidden;">
    <b>', $context['forum_name'], '</b>
    <div class="smalltext">
    </div>
    </td>
    <td valign="top" width="85%" height="100%">
    <table width="100%" border="0"><tr>
    <td valign="middle"><img src="', $message['icon_url'] . '" alt="" border="0" /></td>
    <td valign="middle">
    <div style="font-weight: bold;" id="subject_', $message['id'], '">
    <a href="', $message['href'], '">', $message['subject'], '</a>
    </div>
    <div class="smalltext">&#171; <b>', !empty($message['counter']) ? $txt[146] . ' #' . $message['counter'] : '', ' ', $txt[30], ':</b> ', $message['time'], ' &#187;</div></td>
    <td align="', !$context['right_to_left'] ? 'right' : 'left', '" valign="bottom" height="20" style="font-size: smaller;">';
    if ($context['can_reply'] && !empty($options['display_quick_reply']))
    echo '
    ', $reply_button, '';
   
    // So... quick reply is off, but they *can* reply?
    elseif ($context['can_reply'])
    echo '
    ', $reply_button, '';
   
    // Can the user modify the contents of this post?
    if ($message['can_modify'])
    echo '
    ', $modify_button, '';
   
    // How about... even... remove it entirely?!
    if ($message['can_remove'])
    echo '
    ', $remove_button, '';
   
    // What about splitting it off the rest of the topic?
    if ($context['can_split'])
    echo '
    ', $split_button, '';
    echo '
    </td>
    </tr></table>
    <hr width="100%" size="1" class="hrcolor" />
    <div class="post">', $adpost['type'] == 0 ? $adpost['content'] : eval($adpost['content']) , '</div>
    </td>
    </tr>
    <tr>
    <td valign="bottom" class="smalltext" width="85%">
    <table width="100%" border="0" style="table-layout: fixed;"><tr>
    <td colspan="2" class="smalltext" width="100%">
    </tr><tr>
    <td valign="bottom" class="smalltext" id="modified_', $message['id'], '">
    </td>
    <td align="', !$context['right_to_left'] ? 'right' : 'left', '" valign="bottom" class="smalltext">
    <img src="', $settings['images_url'], '/ip.gif" alt="" border="0" />&nbsp;', $txt[511], '
    </td>
    </tr></table>
    </tr>
    </table>
    </td></tr>
    </table>
    </td></tr>';
    }
    else
    echo '
    <tr><td style="padding: 1px 1px 0 1px;">
    <table width="100%" cellpadding="3" cellspacing="0" border="0">
    <tr>
    <td class="windowbg3">', $adpost['type'] == 0 ? $adpost['content'] : eval($adpost['content']) , '</td>
    </tr>
    </table>
    </td></tr>';
    }
   
    }

      if(function_exists("show_lastpostAds") && function_exists("show_posts"))
      {
      if(($ads = show_lastpostAds()) && !show_posts($adcounter))
      {
      if($modSettings['ads_lookLikePosts'])
      {
      echo '
     
      <tr><td style="padding: 1px 1px 0 1px;">
      <table width="100%" cellpadding="3" cellspacing="0" border="0">
      <tr><td class="windowbg3">
      <table width="100%" cellpadding="5" cellspacing="0" style="table-layout: fixed;">
      <tr>
      <td valign="top" width="16%" rowspan="2" style="overflow: hidden;">
      <b>', $context['forum_name'], '</b>
      <div class="smalltext">
      </div>
      </td>
      <td valign="top" width="85%" height="100%">
      <table width="100%" border="0"><tr>
      <td valign="middle"><img src="', $message['icon_url'] . '" alt="" border="0" /></td>
      <td valign="middle">
      &nbsp;</td>
      <td align="', !$context['right_to_left'] ? 'right' : 'left', '" valign="bottom" height="20" style="font-size: smaller;">';
      if ($context['can_reply'] && !empty($options['display_quick_reply']))
      echo '
      ', $reply_button, '';
     
      // So... quick reply is off, but they *can* reply?
      elseif ($context['can_reply'])
      echo '
      ', $reply_button, '';
     
     
      echo '
      </td>
      </tr></table>
      <hr width="100%" size="1" class="hrcolor" />
      <div class="post">', $ads['type'] == 0 ? $ads['content'] : eval($ads['content']) , '</div>
      </td>
      </tr>
      <tr>
      <td valign="bottom" class="smalltext" width="85%">
      <table width="100%" border="0" style="table-layout: fixed;"><tr>
      <td colspan="2" class="smalltext" width="100%">
      </tr><tr>
      <td valign="bottom" class="smalltext" id="modified_', $message['id'], '">
      </td>
      <td align="', !$context['right_to_left'] ? 'right' : 'left', '" valign="bottom" class="smalltext">
      <img src="', $settings['images_url'], '/ip.gif" alt="" border="0" />&nbsp;', $txt[511], '
      </td>
      </tr></table>
      </tr>
      </table>
      </td></tr>
      </table>
      </td></tr>';
      }
      else
      echo '
      <tr><td style="padding: 1px 1px 0 1px;">
      <table width="100%" cellpadding="3" cellspacing="0" border="0">
      <tr>
      <td class="windowbg3">', $ads['type'] == 0 ? $ads['content'] : eval($ads['content']) , '</td>
      </tr>
      </table>
      </td></tr>';
     
      }
        } 
        //END MESSAGE ADS
   
    echo '</td></tr></table>';
    echo '</td></tr></table><div class="bdc_bd">&nbsp;</div></td></tr>';
    }
    else
I took it all the way down to the else

The next change is at line 1049 and it looks exactly the same, without the else statement.  I hope this helps

Offline whatchamccallum

  • Newbie
  • *
  • Posts: 9
Re: Custom Coding for Wow-Dk Theme
« Reply #9 on: June 18, 2007, 01:12:59 am »
BTW I may have messed up the line numbers when I was going through the code making sense of everything. If they don't match up just look for the signature code.

Offline bigguy

  • Support
  • Elite Member
  • *
  • Posts: 1518
    • SMF Helper
Re: Custom Coding for Wow-Dk Theme
« Reply #10 on: June 20, 2007, 05:09:42 pm »
@ whatchamccallum: I am trying to do both themes TP and SMF but it is slow going. Make sure there is a modifications.english.php file in the language folder of that theme. Then it should work. :)

SMF Ads Support Forum

Re: Custom Coding for Wow-Dk Theme
« Reply #10 on: June 20, 2007, 05:09:42 pm »
.