News:

Version 3.5 has been released. Visit https://custom.simplemachines.org/mods/index.php?mod=255 to get the most up to date version.

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.

wannabee

First off, this MOD is way sweet and totally beyond what I expected!

Thanks Jerm and Big Guy! I just have a quick question and hopefully it's a simple one.

When the ads are posted in between posts it looks like somebody posted it. It has the topic title and the date and then the ad itself.

Is there anyway to have just the ad below the 1st post without the topic and date? I think it kind of distracts from the ad a little bit.

Any guidance on this one?  :)
Well isn't this fun?

bigguy

There is a way to change that. I have seen it posted here. Do a search and you might find it. I am not sure where it is now.

wannabee

I have done several searches with different wording, and have yet to find anything yet!  :-\

Hopefully somebody will chime in.
Well isn't this fun?

jerm

This is done so that it actually looks like a post. That way someone might just click it by accident.
You should look into display.template.php

wannabee

#4
Quote from: jerm on November 22, 2006, 09:25:53 PM
This is done so that it actually looks like a post. That way someone might just click it by accident.
You should look into display.template.php

That's the whole thing, I'd rather it not like like a post, I wouldn't mind if someone clicked on it accidentally.

Thanks for the idea of checking display.template.php. Although I'm not too savvy with PHP, the comments in the code really help! From my novice point of view I can't see where the AD is posted here. Maybe there is a another file I could look at that posts the ad? Or maybe I'm not seeing it.

Any further input is very much anticipated and appreciated.

Thanks!  :)
Well isn't this fun?

wannabee

Well isn't this fun?

jerm

Attach your display.template.php file to your post and i'll fix it up for you.

wannabee

#7
Quote from: jerm on November 23, 2006, 11:29:39 PM
Attach your display.template.php file to your post and i'll fix it up for you.

Wow, that sure is a nice gesture JERM!   8)

I have attached the only file I was able to download which is

"Display.template.php~"

Display.template.php would not let me d/l it. It said:
Transferring Files Failed:
Display.template.php: Failed to open local target file /Users/Joe/Desktop/Display.template.php:Is a directory


So I sure hope I am attaching the right file for you.

BTW: This is kind of the look I was hoping for: http://howardforums.com/showthread.php?t=1049953

Thanks again!!!!!  :)
Well isn't this fun?

bigguy

That file is a backup file of the original. I doubt it will work. (it might) You should contact your host to find out why that file is a directory

jerm


wannabee

OK guys, I finally got the file display.template.php! I have attached it.  :)
Well isn't this fun?

jerm

Try this out.. and remember to not overwrite your other Display.template.php.
Just incase this one doesn't work :)

wannabee

Great... I'll make sure to make a back up of the original. I'll let you know how it works shortly.

Thanks again!
Well isn't this fun?

wannabee

Quote from: jerm on November 27, 2006, 09:43:06 PM
Try this out.. and remember to not overwrite your other Display.template.php.
Just incase this one doesn't work :)

What do you mean just incase, It works perfectly!!!!!

I can't thank you enough. This mod is awesome and the support is 2nd to none!

Thank you kindly for everything!
Joseph


Well isn't this fun?


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:

jerm

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

Voyager

Works perfect. :)  Thanks for your time with this.

g-c

YEAHHAAAA also solves my problem!
So all the Space is now usable...... There is only one Problem: How can i chnage that ugly dark-gray into that color which was used before the changes in display.template.php

g-c

Quote from: g-c on December 10, 2006, 07:02:22 PM
YEAHHAAAA also solves my problem!
So all the Space is now usable...... There is only one Problem: How can i chnage that ugly dark-gray into that color which was used before the changes in display.template.php
PUSH!
How to change the backgroundcolor from that very ugly "dark-grey" into the color which was used before the changes we made...

g-c

It seems that nobody wants to help me - very sad!  :( :(

bigguy

Check in the style.css file. I think you can change it in there.

g-c

Quote from: bigguy on January 03, 2007, 06:57:34 PM
Check in the style.css file. I think you can change it in there.
thanks!!
For all: it's the class .bordercolor .


g-c

Quote from: g-c on January 04, 2007, 06:50:38 AM
Quote from: bigguy on January 03, 2007, 06:57:34 PM
Check in the style.css file. I think you can change it in there.
thanks!!
For all: it's the class .bordercolor .


So my question: can i make a Div box with an id in that area where the adcode is showed by this mod? because that i can format this with css


g-c

well i try it and i add to line with that tables in display.template.php the following: style="background-color:#FDFDFD;"
now everything seems to be ok.

bigguy


puchi

Alguien habla un poco de espaƱol? Necesito una ayuda urgente con este mod.

g-c

Quote from: bigguy on January 12, 2007, 02:09:34 PM
Glad to hear you got it figured. :)
Only a few hours after my testing, Version 2.3 was releasen in which this "function" is already implement.
hehe  :) ;)

Voyager

Quote from: g-c on January 12, 2007, 01:15:36 PM
well i try it and i add to line with that tables in display.template.php the following: style="background-color:#FDFDFD;"
now everything seems to be ok.

Cool that you found it. :)  Now can you share with the rest of us exactly where did you place your code for those of us that don't want to upgrade?

Voyager

I never got an answer so I upgraded one of my forums to the latest admod and still I get the ugly dark color on both sides of my ad between post when I have it centered.

The fix is out there so can someone share what template it is in and where to place it?

Sineksekiz

Quote from: Voyager on January 27, 2007, 03:23:12 PM
I never got an answer so I upgraded one of my forums to the latest admod and still I get the ugly dark color on both sides of my ad between post when I have it centered.

The fix is out there so can someone share what template it is in and where to place it?

I have exactly the same problem. I can't figure out how can we change the color of the background add between messages. It gives you a dark grey which is not cool for the looks of your theme....

If anybody has the answer for this question (including who has solved before) please share whit us.

Thank you.

g-c

Take a Developer-Extension for your Browser, select something like "outline current element" and then you will see which item has which class....

Regards, Christian

Sineksekiz

#46
Quote from: g-c on June 30, 2007, 06:27:58 AM
Take a Developer-Extension for your Browser, select something like "outline current element" and then you will see which item has which class....

Regards, Christian

I have installed this Developer bar and  to install it I have install the Firefox aswell. It is a very nice bar. But result was nothing. Because when I click on the ads post to see which .css file they are attached it showed result as "No style information"...

Then I tried same thing on default theme. Result was same. I bleive these posts does not get any information from a style sheet instead their color are predefined. So how can I change these pre defined colors... OR if I am totlay wrong could you tell me please which style blocks is this mod using. SO I can copy these blocks to my own theme to set the colors.

Thank you.

<<<<<<EDITED>>>>>>

I find what the problem was. You need to ad windowbg3 tab to your modified themes style.css file.

And then change the color settings.