Coinbase

Author Topic: Ads between posts, works great but quick question  (Read 21277 times)

0 Members and 1 Guest are viewing this topic.

Offline fedlerner

  • Newbie
  • *
  • Posts: 4
Re: Ads between posts, works great but quick question
« Reply #15 on: November 30, 2006, 06:26:50 am »
Can you please post what you modified so that others can do it too? :)  :D

Offline Voyager

  • Jr. Member
  • **
  • Posts: 19
    • Email
Re: Ads between posts, works great but quick question
« Reply #16 on: December 02, 2006, 07:14:43 am »
I would like some before and after code myself if it's not to much of a problem Big Guy.

Offline jerm

  • Support
  • Elite Member
  • *
  • Posts: 726
Re: Ads between posts, works great but quick question
« Reply #17 on: December 02, 2006, 03:36:26 pm »
Display.template.php
Code: [Select]
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>';
}

And change to
Code: [Select]
if ($adpost = show_posts($adcounter))
{
               <tr><td>', $adpost['type'] == 0 ? $adpost['content'] : eval($adpost['content']) , '</tr></td>';
        }

« Last Edit: December 03, 2006, 08:04:26 pm by jerm »

Offline Voyager

  • Jr. Member
  • **
  • Posts: 19
    • Email
Re: Ads between posts, works great but quick question
« Reply #18 on: December 02, 2006, 09:46:53 pm »
I tried it out on a test forum and got template parse error:

533:                <tr><td>', $adpost['type'] == 0 ? $adpost['content'] : eval($adpost['content']) , '</tr></td>'';

Offline g-c

  • Jr. Member
  • **
  • Posts: 33
Re: Ads between posts, works great but quick question
« Reply #19 on: December 03, 2006, 12:19:47 pm »
I get also an parse error.
im using SMF1.1 full and newest verion of ad-mod.

With this "idea" of the thread-starter, does this also solving my "problem"
I just want to have more space for a leaderboard-ad between posts so that user with smaller screen-resolutions see no scrollbars.
Just look at the pic:

Thx, Christian

Offline bigguy

  • Support
  • Elite Member
  • *
  • Posts: 1518
    • SMF Helper
Re: Ads between posts, works great but quick question
« Reply #20 on: December 03, 2006, 12:22:14 pm »
Using a smaller ad will acomplish what you want there. That space you have marked in red is for avatar and user info so it is not part of the post, meaning it can't be used without editing the template file. Jerm might know how to do that.

Offline g-c

  • Jr. Member
  • **
  • Posts: 33
Re: Ads between posts, works great but quick question
« Reply #21 on: December 03, 2006, 12:32:32 pm »
That space you have marked in red is for avatar and user info so it is not part of the post, meaning it can't be used without editing the template file..
Yes i know -  and because i know this, i asked if the method described here in this thread would display the "ad-post" complete without that avatar and user-info area?

Thx, Christian

Offline bigguy

  • Support
  • Elite Member
  • *
  • Posts: 1518
    • SMF Helper
Re: Ads between posts, works great but quick question
« Reply #22 on: December 03, 2006, 12:40:35 pm »
As far as I have read in this topic, its for removing the time and date only. Maybe someone knows how to do what you want but I do not.

Offline Voyager

  • Jr. Member
  • **
  • Posts: 19
    • Email
Re: Ads between posts, works great but quick question
« Reply #23 on: December 03, 2006, 01:19:36 pm »
As far as I have read in this topic, its for removing the time and date only. Maybe someone knows how to do what you want but I do not.

Correct Big Guy this topic was for removing the re: of the previous post and the time and date and we are just waiting for jerm to get back to get the correct code to insert.

As for getting rid of the avatar area that is covered in a different post and thier has been no answer to it which means that one might not be a doable thing.

Offline g-c

  • Jr. Member
  • **
  • Posts: 33
Re: Ads between posts, works great but quick question
« Reply #24 on: December 03, 2006, 02:24:04 pm »
As for getting rid of the avatar area that is covered in a different post and thier has been no answer to it which means that one might not be a doable thing.
If i understand you correct, you say that this is not possible?
Well there are so many forums out there in the Internet which using such Advertising between posts - this must be possible!

As you can see here in this Forum, it is possible to show an Ad in that "empty area" (between user-area and "main-area") or at the bottom of the Forum... So if it's not possible to show it like a "post" between posts, including avatar&user info-area -  it should be possible to put an ad between posts when using the empty space of the Forum, so that such a Ad appers not as a post, but as a simple Box which contains the Ad-code.

You know how i mean this?
I hope that Jerm tell us what is possible and what not?

Offline jerm

  • Support
  • Elite Member
  • *
  • Posts: 726
Re: Ads between posts, works great but quick question
« Reply #25 on: December 03, 2006, 08:03:52 pm »
I tried it out on a test forum and got template parse error:

533:                <tr><td>', $adpost['type'] == 0 ? $adpost['content'] : eval($adpost['content']) , '</tr></td>'';
its a single quote at the end, not a double quote.
Code: [Select]
'</tr></td>'';to
Code: [Select]
'</tr></td>';
not sure why i made that mistake, maybe i was tired.

Offline Voyager

  • Jr. Member
  • **
  • Posts: 19
    • Email
Re: Ads between posts, works great but quick question
« Reply #26 on: December 03, 2006, 08:08:53 pm »
I caught that last and I thought I changed it and got the same error. Will give it a try tonight.

Thanks

Offline Voyager

  • Jr. Member
  • **
  • Posts: 19
    • Email
Re: Ads between posts, works great but quick question
« Reply #27 on: December 04, 2006, 10:18:47 am »
I gave it a try and still get the same parse error. Went through the begging code and removed what I thought would get rid of "re:post and time" and it worked except I ended up with a blank box with no ad.

Shows how good I'm at this coding. :'(

Offline jerm

  • Support
  • Elite Member
  • *
  • Posts: 726
Re: Ads between posts, works great but quick question
« Reply #28 on: December 04, 2006, 11:56:46 am »
show me the code you are using.

Offline Voyager

  • Jr. Member
  • **
  • Posts: 19
    • Email
Re: Ads between posts, works great but quick question
« Reply #29 on: December 10, 2006, 09:48:43 am »
Here it is,

Parse error: syntax error, unexpected '<' in .../Themes/default/Display.template.php on line 533

524:                   </td>
525:                </tr>
526:             </table>
527:          </td></tr>
528:       </table>
529:    </td></tr>';
530:    if ($adpost = show_posts($adcounter))
531:    
532: {
533:                <tr><td>', $adpost['type'] == 0 ? $adpost['content'] : eval($adpost['content']) , '</tr></td>';534:         }
535:

SMF Ads Support Forum

Re: Ads between posts, works great but quick question
« Reply #29 on: December 10, 2006, 09:48:43 am »
.

 

.