News:

Welcome to SMF Ads Support Forum

Main Menu
Coinbase

Ads between posts, works great but quick question

Started by wannabee, November 20, 2006, 10:47:32 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

fedlerner

Can you please post what you modified so that others can do it too? :)  :D

Voyager

I would like some before and after code myself if it's not to much of a problem Big Guy.

jerm

#17
Display.template.php

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

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



Voyager

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

g-c

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

bigguy

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.

g-c

Quote from: bigguy on December 03, 2006, 12:22:14 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

bigguy

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.

Voyager

Quote from: bigguy 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.

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.

g-c

Quote from: Voyager on December 03, 2006, 01:19:36 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?

jerm

Quote from: Voyager 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>'';
its a single quote at the end, not a double quote.
'</tr></td>'';
to
'</tr></td>';

not sure why i made that mistake, maybe i was tired.

Voyager

I caught that last and I thought I changed it and got the same error. Will give it a try tonight.

Thanks

Voyager

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. :'(

jerm


Voyager

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: