swiss73 Posted December 3, 2006 Share Posted December 3, 2006 hello there. The FIRST post in topics on the php freaks forums shows a google ad. I tried to do something similar to this on my forums using the following div.... [code]<div class="titlebg2" style="padding: 20px; margin-left: 20px; float:right">[/code]the content of the div still pushed the whole post below its level ...... what am I missing ? I would like to float this div content to the right...... as the google ad on php freaks first post.... Quote Link to comment Share on other sites More sharing options...
ToonMariner Posted December 3, 2006 Share Posted December 3, 2006 try giving your div a width. Quote Link to comment Share on other sites More sharing options...
swiss73 Posted December 3, 2006 Author Share Posted December 3, 2006 [quote author=ToonMariner link=topic=117160.msg477864#msg477864 date=1165155803]try giving your div a width.[/quote]no dear. did not work. Quote Link to comment Share on other sites More sharing options...
wildteen88 Posted December 4, 2006 Share Posted December 4, 2006 If you are using SMF,. then the following should do:[code]<div style="margin-left: 20px;float:right">Google Ads javasript here</div>[/code]You place that code directly after the <div class="post"> tag and it should display the adds to the right of the text. ALso the text should warp it self around the ad too, however code/quote blocks do tend to flow over the top the ads. This is a z-index issue i think. Quote Link to comment Share on other sites More sharing options...
swiss73 Posted December 5, 2006 Author Share Posted December 5, 2006 [quote author=wildteen88 link=topic=117160.msg478566#msg478566 date=1165255502]If you are using SMF,. then the following should do:[code]<div style="margin-left: 20px;float:right">Google Ads javasript here</div>[/code]You place that code directly after the <div class="post"> tag and it should display the adds to the right of the text. ALso the text should warp it self around the ad too, however code/quote blocks do tend to flow over the top the ads. This is a z-index issue i think.[/quote]I apologize to disturb you with this, but I am really lost. here is the code in the display.template.php[code] // Show the post itself, finally! echo ' </td> </tr></table> <hr width="100%" size="1" class="hrcolor" />'; echo ' <div class="post"', $message['can_modify'] ? ' id="msg_' . $message['id'] . '"' : '', '>', $message['body'], '</div>', $message['can_modify'] ? ' <img src="' . $settings['images_url'] . '/icons/modify_inline.gif" alt="" align="right" id="modify_button_' . $message['id'] . '" style="cursor: pointer; display: none;" onclick="modify_msg(\'' . $message['id'] . '\', \'' . $context['session_id'] . '\')" />' : '', ' </td> </tr>'; // Now for the attachments, signature, ip logged, etc...[/code]what I want to insert is in a pure html file, as such include("html.inc.php");please let me know how to modify the code without breaking the template. Quote Link to comment Share on other sites More sharing options...
wildteen88 Posted December 5, 2006 Share Posted December 5, 2006 Yes you can. You'll wnat to chnage this code:[code]/ Show the post itself, finally! echo ' </td> </tr></table> <hr width="100%" size="1" class="hrcolor" />'; echo ' <div class="post"', $message['can_modify'] ? ' id="msg_' . $message['id'] . '"' : '', '>', $message['body'], '</div>', $message['can_modify'] ? ' <img src="' . $settings['images_url'] . '/icons/modify_inline.gif" alt="" align="right" id="modify_button_' . $message['id'] . '" style="cursor: pointer; display: none;" onclick="modify_msg(\'' . $message['id'] . '\', \'' . $context['session_id'] . '\')" />' : '', ' </td> </tr>'; // Now for the attachments, signature, ip logged, etc..[/code]to this:[code] // Show the post itself, finally! echo ' </td> </tr></table> <hr width="100%" size="1" class="hrcolor" /> <div class="post"', $message['can_modify'] ? ' id="msg_' . $message['id'] . '"' : '', '>'; include('./Themes/default/html.inc.php'); echo $message['body'], '</div>', $message['can_modify'] ? ' <img src="' . $settings['images_url'] . '/icons/modify_inline.gif" alt="" align="right" id="modify_button_' . $message['id'] . '" style="cursor: pointer; display: none;" onclick="modify_msg(\'' . $message['id'] . '\', \'' . $context['session_id'] . '\')" />' : '' , ' </td> </tr>'; // Now for the attachments, signature, ip logged, etc...[/code]Now you'll want to create the html.inc.php file in {SMF_ROOT_FOLDER}/Themes/default now edit that file and add the relevant html to that file. It should now include that file for ever post in the thread.If you want it only show for the first post in the thread then you'll want change this:[code]<div class="post"', $message['can_modify'] ? ' id="msg_' . $message['id'] . '"' : '', '>'; include('./Themes/default/html.inc.php'); echo $message['body'], '</div>', $message['can_modify'] ? '[/code]To the following:[code]<div class="post"', $message['can_modify'] ? ' id="msg_' . $message['id'] . '"' : '', '>'; if(!isset($fPOST) || $fPOST != true) { include('./Themes/default/html.inc.php'); $fPOST = true; } echo $message['body'], '</div>', $message['can_modify'] ? '[/code] Quote Link to comment Share on other sites More sharing options...
swiss73 Posted December 6, 2006 Author Share Posted December 6, 2006 I honestly don't know how to thank you wildteen88I rarely was helped so well even when I paid for the support. (Y) Quote Link to comment Share on other sites More sharing options...
wildteen88 Posted December 6, 2006 Share Posted December 6, 2006 No problem. I am getting used how SMF works now and I am able to hack it into shape in a couple of mins.If you have anymore questions/problems with this or SMF Templates then please post in the Third Party PHP Scripts forum. I should of told you this earlier but I let you off. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.