News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Help: Show ads Inside 1st Post

Started by Metal_13, June 29, 2008, 02:47:21 AM

Previous topic - Next topic

Metal_13

i wanna put my ads on the first post... not after the first post like ad mod but inside the post....
before and after the content inside the post....
heres a sample... ull see google ads on top and under the 1st post...

http://www.free-stuffs.cn/viewthread.php?tid=90&extra=page%3D1

does anyone here know how to do this?

i really need it...

Bulakbol

Edit your Display.template.php. Find
Quote<div class="post"', $message['can_modify'] ? ' id="msg_' . $message['id'] . '"' : '', '>', $message['body'], '</div>', $message['can_modify'] ? '

and replace
Quote<div class="post"', $message['can_modify'] ? ' id="msg_' . $message['id'] . '"' : '', '>';
                     if ($message['id'] == $context['first_message'])
                        echo '<div align="center">Place your Ads here</div>';
                     echo '                     
                     ', $message['body'], '</div>', $message['can_modify'] ? '
Please do not PM me for support · My Mods and Theme · SMF Coding Guidelines · Modifications Approval Guidelines

Metal_13

#2
Hi, Thanks a lot for the reply... :D but i cant find the line u said.... is that code for 2.0 beta?

heres my display temp .php
<?php
// Version: 2.0 Beta 3 Public; Display

function template_main()
{
global $context$settings$options$txt$scripturl$modSettings;

// Show the anchor for the top and for the first message. If the first message is new, say so.
echo '
<a name="top"></a>
<a name="msg'
$context['first_message'], '"></a>'$context['first_new_message'] ? '<a name="new"></a>' '';

// Show the linktree
echo '
<div>'
theme_linktree(), '</div>';

// Is this topic also a poll?
if ($context['is_poll'])
{
echo '
<table cellpadding="3" cellspacing="0" border="0" width="100%" class="tborder" style="padding-top: 0; margin-bottom: 2ex;">
<tr>
<td class="titlebg" colspan="2" valign="middle" style="padding-left: 6px;">
<img src="'
$settings['images_url'], '/topic/'$context['poll']['is_locked'] ? 'normal_poll_locked' 'normal_poll''.gif" alt="" align="bottom" /> '$txt['poll'], '
</td>
</tr>
<tr>
<td width="5%" valign="top" class="windowbg"><b>'
$txt['poll_question'], ':</b></td>
<td class="windowbg">
'
$context['poll']['question'];
if (!empty($context['poll']['expire_time']))
echo '
&nbsp;('
, ($context['poll']['is_expired'] ? $txt['poll_expired_on'] : $txt['poll_expires_on']), ': '$context['poll']['expire_time'], ')';

// Are they not allowed to vote but allowed to view the options?
if ($context['poll']['show_results'] || !$context['allow_vote'])
{
echo '
<table>
<tr>
<td style="padding-top: 2ex;">
<table border="0" cellpadding="0" cellspacing="0">'
;

// Show each option with its corresponding percentage bar.
foreach ($context['poll']['options'] as $option)
echo '
<tr>
<td style="padding-right: 2ex;'
$option['voted_this'] ? 'font-weight: bold;' '''">'$option['option'], '</td>'$context['allow_poll_view'] ? '
<td nowrap="nowrap">' 
$option['bar'] . ' ' $option['votes'] . ' (' $option['percent'] . '%)</td>' '''
</tr>'
;

echo '
</table>
</td>
<td valign="bottom" style="padding-left: 15px;">'
;

// If they are allowed to revote - show them a link!
if ($context['allow_change_vote'])
echo '
<a href="'
$scripturl'?action=vote;topic='$context['current_topic'], '.'$context['start'], ';poll='$context['poll']['id'], ';sesc='$context['session_id'], '">'$txt['poll_change_vote'], '</a><br />';

// If we're viewing the results... maybe we want to go back and vote?
if ($context['poll']['show_results'] && $context['allow_vote'])
echo '
<a href="'
$scripturl'?topic='$context['current_topic'], '.'$context['start'], '">'$txt['poll_return_vote'], '</a><br />';

// If they're allowed to lock the poll, show a link!
if ($context['poll']['lock'])
echo '
<a href="'
$scripturl'?action=lockvoting;topic='$context['current_topic'], '.'$context['start'], ';sesc='$context['session_id'], '">', !$context['poll']['is_locked'] ? $txt['poll_lock'] : $txt['poll_unlock'], '</a><br />';

// If they're allowed to edit the poll... guess what... show a link!
if ($context['poll']['edit'])
echo '
<a href="'
$scripturl'?action=editpoll;topic='$context['current_topic'], '.'$context['start'], '">'$txt['poll_edit'], '</a>';

echo '
</td>
</tr>'
$context['allow_poll_view'] ? '
<tr>
<td colspan="2"><b>' 
$txt['poll_total_voters'] . ': ' $context['poll']['total_votes'] . '</b></td>
</tr>' 
'''
</table><br />'
;
}
// They are allowed to vote! Go to it!
else
{
echo '
<form action="'
$scripturl'?action=vote;topic='$context['current_topic'], '.'$context['start'], ';poll='$context['poll']['id'], '" method="post" accept-charset="'$context['character_set'], '" style="margin: 0px;">
<table>
<tr>
<td colspan="2">'
;

// Show a warning if they are allowed more than one option.
if ($context['poll']['allowed_warning'])
echo '
'
$context['poll']['allowed_warning'], '
</td>
</tr><tr>
<td>'
;

// Show each option with its button - a radio likely.
foreach ($context['poll']['options'] as $option)
echo '
'
$option['vote_button'], ' <label for="'$option['id'], '">'$option['option'], '</label><br />';

echo '
</td>
<td valign="bottom" style="padding-left: 15px;">'
;

// Allowed to view the results? (without voting!)
if ($context['allow_poll_view'])
echo '
<a href="'
$scripturl'?topic='$context['current_topic'], '.'$context['start'], ';viewResults">'$txt['poll_results'], '</a><br />';

// Show a link for locking the poll as well...
if ($context['poll']['lock'])
echo '
<a href="'
$scripturl'?action=lockvoting;topic='$context['current_topic'], '.'$context['start'], ';sesc='$context['session_id'], '">', (!$context['poll']['is_locked'] ? $txt['poll_lock'] : $txt['poll_unlock']), '</a><br />';

// Want to edit it? Click right here......
if ($context['poll']['edit'])
echo '
<a href="'
$scripturl'?action=editpoll;topic='$context['current_topic'], '.'$context['start'], '">'$txt['poll_edit'], '</a>';

echo '
</td>
</tr><tr>
<td colspan="2"><input type="submit" value="'
$txt['poll_vote'], '" /></td>
</tr>
</table>
<input type="hidden" name="sc" value="'
$context['session_id'], '" />
</form>'
;
}

echo '
</td>
</tr>
</table>'
;
}

// Does this topic have some events linked to it?
if (!empty($context['linked_calendar_events']))
{
echo '
<table cellpadding="3" cellspacing="0" border="0" width="100%" class="tborder" style="padding-top: 0; margin-bottom: 3ex;">
<tr>
<td class="titlebg" valign="middle" align="left" style="padding-left: 6px;">
'
$txt['calendar_linked_events'], '
</td>
</tr>
<tr>
<td width="5%" valign="top" class="windowbg">
<ul>'
;
foreach ($context['linked_calendar_events'] as $event)
echo '
<li>
'
, ($event['can_edit'] ? '<a href="' $event['modify_href'] . '" style="color: red;">*</a> ' ''), '<b>'$event['title'], '</b>: '$event['start_date'], ($event['start_date'] != $event['end_date'] ? ' - ' $event['end_date'] : ''), '
</li>'
;
echo '
</ul>
</td>
</tr>
</table>'
;
}

// Build the normal button array.
$normal_buttons = array(
'reply' => array('test' => 'can_reply''text' => 'reply''image' => 'reply.gif''lang' => true'url' => $scripturl '?action=post;topic=' $context['current_topic'] . '.' $context['start'] . ';num_replies=' $context['num_replies']),
'notify' => array('test' => 'can_mark_notify''text' => 'notify''image' => 'notify.gif''lang' => true'custom' => 'onclick="return confirm(\'' . ($context['is_marked_notify'] ? $txt['notification_disable_topic'] : $txt['notification_enable_topic']) . '\');"''url' => $scripturl '?action=notify;sa=' . ($context['is_marked_notify'] ? 'off' 'on') . ';topic=' $context['current_topic'] . '.' $context['start'] . ';sesc=' $context['session_id']),
'custom' => array(),
'send' => array('test' => 'can_send_topic''text' => 'send_topic''image' => 'sendtopic.gif''lang' => true'url' => $scripturl '?action=emailuser;sa=sendtopic;topic=' $context['current_topic'] . '.0'),
'print' => array('text' => 'print''image' => 'print.gif''lang' => true'custom' => 'rel="new_win nofollow"''url' => $scripturl '?action=printpage;topic=' $context['current_topic'] . '.0'),
);

// Special case for the custom one.
if ($context['user']['is_logged'] && $settings['show_mark_read'])
$normal_buttons['custom'] = array('text' => 'mark_unread''image' => 'markunread.gif''lang' => true'url' => $scripturl '?action=markasread;sa=topic;t=' $context['mark_unread_time'] . ';topic=' $context['current_topic'] . '.' $context['start'] . ';sesc=' $context['session_id']);
elseif ($context['can_add_poll'])
$normal_buttons['custom'] = array('text' => 'add_poll''image' => 'add_poll.gif''lang' => true'url' => $scripturl '?action=editpoll;add;topic=' $context['current_topic'] . '.' $context['start'] . ';sesc=' $context['session_id']);
else
unset($normal_buttons['custom']);

// Show the page index... "Pages: [1]".
echo '
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="middletext" valign="bottom" style="padding-bottom: 4px;">'
$txt['pages'], ': '$context['page_index'], !empty($modSettings['topbottomEnable']) ? $context['menu_separator'] . ' &nbsp;&nbsp;<a href="#lastPost"><b>' $txt['go_down'] . '</b></a>' '''</td>
<td align="right" style="padding-right: 1ex;">
<div class="nav" style="margin-bottom: 2px;"> '
$context['previous_next'], '</div>
<table cellpadding="0" cellspacing="0">
<tr>
'
template_button_strip($normal_buttons'bottom'), '
</tr>
</table>
</td>
</tr>
</table>'
;

// Show the topic information - icon, subject, etc.
echo '
<table width="100%" cellpadding="3" cellspacing="0" border="0" class="tborder" style="border-bottom: 0;">
<tr class="catbg3">
<td valign="middle" width="2%" style="padding-left: 6px;">
<img src="'
$settings['images_url'], '/topic/'$context['class'], '.gif" align="bottom" alt="" />
</td>
<td width="13%"> '
$txt['author'], '</td>
<td valign="middle" width="85%" style="padding-left: 6px;" id="top_subject">
'
$txt['topic'], ': '$context['subject'], ' &nbsp;('$txt['read'], ' '$context['num_views'], ' '$txt['times'], ')
</td>
</tr>'
;
if (!empty($settings['display_who_viewing']))
{
echo '
<tr>
<td colspan="3" class="smalltext">'
;

// Show just numbers...?
if ($settings['display_who_viewing'] == 1)
echo count($context['view_members']), ' 'count($context['view_members']) == $txt['who_member'] : $txt['members'];
// Or show the actual people viewing the topic?
else
echo empty($context['view_members_list']) ? '0 ' $txt['members'] : implode(', '$context['view_members_list']) . ((empty($context['view_num_hidden']) || $context['can_moderate_forum']) ? '' ' (+ ' $context['view_num_hidden'] . ' ' $txt['hidden'] . ')');

// Now show how many guests are here too.
echo $txt['who_and'], $context['view_num_guests'], ' '$context['view_num_guests'] == $txt['guest'] : $txt['guests'], $txt['who_viewing_topic'], '
</td>
</tr>'
;
}

echo '
</table>'
;

echo '
<form action="'
$scripturl'?action=quickmod2;topic='$context['current_topic'], '.'$context['start'], '" method="post" accept-charset="'$context['character_set'], '" name="quickModForm" id="quickModForm" style="margin: 0;" onsubmit="return oQuickModify.bInEditMode ? oQuickModify.modifySave(\'' $context['session_id'] . '\') : confirm(\'' $txt['quickmod_confirm'] . '\');">';

// These are some cache image buttons we may want.
$reply_button create_button('quote.gif''reply_quote''quote''align="middle"');
$modify_button create_button('modify.gif''modify_msg''modify''align="middle"');
$remove_button create_button('delete.gif''remove_message''remove''align="middle"');
$split_button create_button('split.gif''split''split''align="middle"');
$approve_button create_button('approve.gif''approve''approve''align="middle"');
$restore_message_button create_button('restore_topic.gif''restore_message''restore_message''align="middle"');

// Time to display all the posts
echo '
<table cellpadding="0" cellspacing="0" border="0" width="100%" class="bordercolor">'
;

$ignoredMsgs = array();

// Get all the messages...
while ($message $context['get_message']())
{
$ignoring false;
echo '
<tr><td style="padding: 1px 1px 0 1px;">'
;

if (in_array($message['member']['id'], $context['user']['ignoreusers']))
{
$ignoring true;
$ignoredMsgs[] = $message['id'];
}

// Show the message anchor and a "new" anchor if this message is new.
if ($message['id'] != $context['first_message'])
echo '
<a name="msg'
$message['id'], '"></a>'$message['first_new'] ? '<a name="new"></a>' '';

echo '
<table width="100%" cellpadding="3" cellspacing="0" border="0" >
<tr><td class="'
$message['approved'] ? ($message['alternate'] == 'windowbg' 'windowbg2') : 'approvebg''">';

// Show information about the poster of this message.
echo '
<table width="100%" cellpadding="5" cellspacing="0" style="table-layout: fixed;">
<tr>





<!-- google_ad_section_start(weight=ignore) -->
<td valign="top" width="16%" rowspan="2" style="overflow: hidden;">





<div style="border-right-style: solid; border-right-width: 1px; padding-right: 4px">





<table cellpadding="0" cellspacing="0" width="100%">
<tr>
<td height="5" style="border-top-style: solid; border-top-width: 1px" background="http://www.pinoytambaygroup.com/forum/Themes/outline20b3/images/catbg.gif" >




'
$message['member']['gender']['image'], 


<b>
<font color="#FFFFFF">
'
$message['member']['link'], '
</font>

</b>



</td>
</tr>
<tr>
<td height="14" style="border-top-style: solid; border-top-width: 1px" bgcolor="#F3F3F3" background="http://www.pinoytambaygroup.com/forum/Themes/outline20b3/images/custom/body-bg.gif"  >


<p align="center">'
$message['member']['avatar']['image'], '




</td>
</tr>
</table>




<div class="smalltext" id="msg_'
$message['id'], '_extra_info">';











// Show the member's custom title, if they have one.
if (isset($message['member']['title']) && $message['member']['title'] != '')
echo '
'
$message['member']['title'], '';










// Show avatars, images, etc.?
if (!empty($settings['show_user_images']) && empty($options['show_no_avatars']) && !empty($message['member']['avatar']['image']))
echo '
<div style="overflow: auto; width: 100%;"></div>'
;



// Don't show these things for guests.
if (!$message['member']['is_guest'])
{
// Show the post group if and only if they have no other group or the option is on, and they are in a post group.
if ((empty($settings['hide_post_group']) || $message['member']['group'] == '') && $message['member']['post_group'] != '')

echo '
'
$message['member']['group_stars'], '

<table cellpadding="0" cellspacing="0" width="100%" height="13">

<tr>
<td valign="top" bgcolor="#333333" style="border-left-style: solid; border-left-width: 1px; border-right-style: solid; border-right-width: 1px; border-top-style: solid; border-top-width: 1px" height="14">
<font face="Arial"><span style="font-size: 8pt">&nbsp;<font color="#FFFFFF">My 
Badge(s)</font></span></font></td>
</tr>
<tr>
<td valign="top" style="border-left-style: solid; border-left-width: 1px; border-right-style: solid; border-right-width: 1px; border-bottom-style: solid; border-bottom-width: 1px" height="1" width="100%">

'
;

if (!empty($context['badges']['ownline']))
{
foreach($context['badges']['ownline'] AS $key)
for ($i 0$i count($message['member']['additional_groups']['id']); $i++)
 if ($message['member']['additional_groups']['id'][$i] == $key)
   echo $message['member']['additional_groups']['stars'][$i], '';
}    
elseif (!empty($message['member']['additional_groups']['id']))
for ($i 0$i count($message['member']['additional_groups']['id']); $i++)
echo $message['member']['additional_groups']['stars'][$i], '';














// Is karma display enabled?  Total or +/-?
if ($modSettings['karmaMode'] == '1')
echo '









</td>
</tr>
</table>













<br />
'
$modSettings['karmaLabel'], ' '$message['member']['karma']['good'] - $message['member']['karma']['bad'], '<br />';
elseif ($modSettings['karmaMode'] == '2')
echo '
<br />
'
$modSettings['karmaLabel'], ' +'$message['member']['karma']['good'], '/-'$message['member']['karma']['bad'], '<br />';

// Is this user allowed to modify this member's karma?
if ($message['member']['karma']['allow'])
echo '
<a href="'
$scripturl'?action=modifykarma;sa=applaud;uid='$message['member']['id'], ';topic='$context['current_topic'], '.' $context['start'], ';m='$message['id'], ';sesc='$context['session_id'], '">'$modSettings['karmaApplaudLabel'], '</a>
<a href="'
$scripturl'?action=modifykarma;sa=smite;uid='$message['member']['id'], ';topic='$context['current_topic'], '.'$context['start'], ';m='$message['id'], ';sesc='$context['session_id'], '">'$modSettings['karmaSmiteLabel'], '</a><br />';

// Show online and offline buttons?
if (!empty($modSettings['onlineEnable']) && !$message['member']['is_guest'])
echo '
'
$context['can_send_pm'] ? '<a href="' $message['member']['online']['href'] . '" title="' $message['member']['online']['label'] . '">' ''$settings['use_image_buttons'] ? '<img src="' $message['member']['online']['image_href'] . '" alt="' $message['member']['online']['text'] . '" border="0" style="margin-top: 2px;" />' $message['member']['online']['text'], $context['can_send_pm'] ? '</a>' ''$settings['use_image_buttons'] ? '<span class="smalltext"> ' $message['member']['online']['text'] . '</span>' '''<br />';



// Show how many posts they have made.
if (!isset($context['disabled_fields']['posts']))
echo '
'
$txt['member_postcount'], ': '$message['member']['posts'], '';

// Any custom fields?
if (!empty($message['member']['custom_fields']))
{
foreach ($message['member']['custom_fields'] as $custom)
echo '
'
$custom['title'], ': '$custom['value'], '<br />';
}

echo '<br />';


// Show their personal text?
if (!empty($settings['show_blurb']) && $message['member']['blurb'] != '')
echo '
'
$message['member']['blurb'], '<br />
'
;

// This shows the popular messaging icons.
echo '
'
, !isset($context['disabled_fields']['icq']) ? $message['member']['icq']['link'] : '''
'
, !isset($context['disabled_fields']['msn']) ? $message['member']['msn']['link'] : '''
'
, !isset($context['disabled_fields']['aim']) ? $message['member']['aim']['link'] : '''
'
, !isset($context['disabled_fields']['yim']) ? $message['member']['yim']['link'] : '''
'
;

// Show the profile, website, email address, and personal message buttons.
if ($settings['show_profile_buttons'])
{
// Don't show the profile button if you're not allowed to view the profile.
if ($message['member']['can_view_profile'])
echo '
<a href="'
$message['member']['href'], '">', ($settings['use_image_buttons'] ? '<img src="' $settings['images_url'] . '/icons/profile_sm.gif" alt="' $txt['view_profile'] . '" title="' $txt['view_profile'] . '" border="0" />' $txt['view_profile']), '</a>';

// Don't show an icon if they haven't specified a website.
if ($message['member']['website']['url'] != '' && !isset($context['disabled_fields']['website']))
echo '
<a href="'
$message['member']['website']['url'], '" title="' $message['member']['website']['title'] . '" target="_blank" class="new_win">', ($settings['use_image_buttons'] ? '<img src="' $settings['images_url'] . '/www_sm.gif" alt="' $txt['www'] . '" border="0" />' $txt['www']), '</a>';

// Don't show the email address if they want it hidden.
if (in_array($message['member']['show_email'], array('yes''yes_permission_override''no_through_forum')))
echo '
<a href="'
$message['member']['show_email'] == 'no_through_forum' $scripturl '?action=emailuser;sa=email;msg=' $message['id'] : 'mailto:' $message['member']['email'], '" rel="nofollow">', ($settings['use_image_buttons'] ? '<img src="' $settings['images_url'] . '/email_sm.gif" alt="' $txt['email'] . '" title="' $txt['email'] . '" />' $txt['email']), '</a>';

// Since we know this person isn't a guest, you *can* message them.
if ($context['can_send_pm'])
echo '
<a href="'
$scripturl'?action=pm;sa=send;u='$message['member']['id'], '" title="'$message['member']['online']['label'], '">'$settings['use_image_buttons'] ? '<img src="' $settings['images_url'] . '/im_' . ($message['member']['online']['is_online'] ? 'on' 'off') . '.gif" alt="' $message['member']['online']['label'] . '" border="0" />' $message['member']['online']['label'], '</a>';
}

// Are we showing the warning status?
if (!isset($context['disabled_fields']['warning_status']) && $message['member']['warning_status'] && ($context['user']['can_mod'] || !empty($modSettings['warning_show'])))
echo '
<br />
'
$context['can_issue_warning'] ? '<a href="' $scripturl '?action=profile;u=' $message['member']['id'] . ';sa=issueWarning">' '''<img src="'$settings['images_url'], '/warning_'$message['member']['warning_status'], '.gif" alt="'$txt['user_warn_' $message['member']['warning_status']], '"/>'$context['can_issue_warning'] ? '</a>' '''<span class="warn_'$message['member']['warning_status'], '">'$txt['warn_' $message['member']['warning_status']], '</span>';
}
// Otherwise, show the guest's email.
elseif (in_array($message['member']['show_email'], array('yes''yes_permission_override''no_through_forum')))
echo '
<br />
<br />
<a href="'
$message['member']['show_email'] == 'no_through_forum' $scripturl '?action=emailuser;sa=email;msg=' $message['id'] : 'mailto:' $message['member']['email'], '" rel="nofollow">', ($settings['use_image_buttons'] ? '<img src="' $settings['images_url'] . '/email_sm.gif" alt="' $txt['email'] . '" title="' $txt['email'] . '" border="0" />' $txt['email']), '</a>';

// Done with the information about the poster... on to the post itself.
echo '


</div></div>
</td>
<!-- google_ad_section_end -->
<!-- google_ad_section_start -->
<td valign="top" width="85%" height="100%">
<table width="100%" border="0"><tr>
<td valign="middle"><img src="'
$message['icon_url'] . '" alt="" border="0"'$message['can_modify'] ? ' id="msg_icon_' $message['id'] . '"' ''' /></td>
<td valign="middle">
<div style="font-weight: bold;" id="subject_'
$message['id'], '">
<a href="'
$message['href'], '">'$message['subject'], '</a>
</div>'
;

// If this is the first post, (#0) just say when it was posted - otherwise give the reply #.
echo '
<div class="smalltext">&#38;#38;#171; <b>'
, !empty($message['counter']) ? $txt['reply'] . ' #' $message['counter'] : ''' '$txt['on'], ':</b> '$message['time'], ' &#38;#38;#187;</div></td>
<td align="'
, !$context['right_to_left'] ? 'right' 'left''" valign="bottom" height="20" style="font-size: smaller;"><div id="msg_'$message['id'], '_quick_mod">';

// Maybe we can approve it, maybe we should?
if ($message['can_approve'])
echo '
<a href="'
$scripturl'?action=moderate;area=postmod;sa=approve;topic='$context['current_topic'], '.'$context['start'], ';msg='$message['id'], ';sesc='$context['session_id'], '">'$approve_button'</a>';

// Can they reply? Have they turned on quick reply?
if ($context['can_reply'] && !empty($options['display_quick_reply']))
echo '
<a href="'
$scripturl'?action=post;quote='$message['id'], ';topic='$context['current_topic'], '.'$context['start'], ';num_replies='$context['num_replies'], ';sesc='$context['session_id'], '" onclick="return oQuickReply.quote('$message['id'], ', \''$context['session_id'], '\', true);">'$reply_button'</a>';

// So... quick reply is off, but they *can* reply?
elseif ($context['can_reply'])
echo '
<a href="'
$scripturl'?action=post;quote='$message['id'], ';topic='$context['current_topic'], '.'$context['start'], ';num_replies='$context['num_replies'], ';sesc='$context['session_id'], '">'$reply_button'</a>';

// Can the user modify the contents of this post?
if ($message['can_modify'])
echo '
<a href="'
$scripturl'?action=post;msg='$message['id'], ';topic='$context['current_topic'], '.'$context['start'], ';sesc='$context['session_id'], '">'$modify_button'</a>';

// How about... even... remove it entirely?!
if ($message['can_remove'])
echo '
<a href="'
$scripturl'?action=deletemsg;topic='$context['current_topic'], '.'$context['start'], ';msg='$message['id'], ';sesc='$context['session_id'], '" onclick="return confirm(\''$txt['remove_message'], '?\');">'$remove_button'</a>';

// What about splitting it off the rest of the topic?
if ($context['can_split'])
echo '
<a href="'
$scripturl'?action=splittopics;topic='$context['current_topic'], '.0;at='$message['id'], '">'$split_button'</a>';

// Can we restore topics?
if ($context['can_restore_msg'])
echo '
<a href="'
$scripturl'?action=restoretopic;topic='$context['current_topic'], ';msg='$message['id'], ';sesc='$context['session_id'], '">'$restore_message_button'</a>';

// Show a checkbox for quick moderation?
if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == && $message['can_remove'])
echo '
<input type="checkbox" name="msgs[]" value="'
$message['id'], '" class="check" ', empty($settings['use_tabs']) ? 'onclick="document.getElementById(\'quickmodSubmit\').style.display = \'\';"' ''' />';

// Show the post itself, finally!
echo '
</div></td>
</tr></table>
<hr width="100%" size="1" class="hrcolor" />'
;
if ($ignoring)
echo ' <div id="msg_'$message['id'], '_ignored_prompt" style="display: none;">'$txt['ignoring_user'], '  <a href="#msg'$message['id'], '" onclick="return ignoreToggles['$message['id'], '].toggle()">'$txt['show_ignore_user_post'], '</a></div>';

echo '
<div class="post" id="msg_'
$message['id'], '"''>';

if (!$message['approved'] && $message['member']['id'] != && $message['member']['id'] == $context['user']['id'])
echo '
<div style="margin: 2ex; padding: 1ex; border: 2px dashed #cc3344; color: black; font-weight: bold;">
'
$txt['post_awaiting_approval'], '
</div>'
;
echo '
'
$message['body'], '
</div>'
$message['can_modify'] ? '
<img src="' 
$settings['images_url'] . '/icons/modify_inline.gif" alt="' $txt['quick_modify'] . '" title="' $txt['quick_modify'] . '" align="right" id="modify_button_' $message['id'] . '" style="cursor: ' . ($context['browser']['is_ie5'] || $context['browser']['is_ie5.5'] ? 'hand' 'pointer') . '; display: none;" onclick="oQuickModify.modifyMsg(\'' $message['id'] . '\', \'' $context['session_id'] . '\')" />' '' '
</td>
<!-- google_ad_section_end -->
</tr>'
;

// Now for the attachments, signature, ip logged, etc...
echo '
<!-- google_ad_section_start(weight=ignore) -->
<tr id="msg_'
$message['id'], '_footer">
<td valign="bottom" class="smalltext" width="85%">
<table width="100%" border="0" style="table-layout: fixed;"><tr>
<td colspan="2" class="smalltext" width="100%">'
;

// Assuming there are attachments...
if (!empty($message['attachment']))
{
echo '
<hr width="100%" size="1" class="hrcolor" />
<div style="overflow: auto; width: 100%;">'
;
$last_approved_state 1;
foreach ($message['attachment'] as $attachment)
{
// Show a special box for unapproved attachments...
if ($attachment['is_approved'] != $last_approved_state)
{
$last_approved_state 0;
echo '
<fieldset>
<legend>'
$txt['attach_awaiting_approve'], '&nbsp;[<a href="'$scripturl'?action=attachapprove;sa=all;mid='$message['id'], ';sesc='$context['session_id'], '">'$txt['approve_all'], '</a>]</legend>';
}

if ($attachment['is_image'])
{
if ($attachment['thumbnail']['has_thumb'])
echo '
<a href="'
$attachment['href'], ';image" id="link_'$attachment['id'], '" onclick="'$attachment['thumbnail']['javascript'], '"><img src="'$attachment['thumbnail']['href'], '" alt="" id="thumb_'$attachment['id'], '" border="0" /></a><br />';
else
echo '
<img src="' 
$attachment['href'] . ';image" alt="" width="' $attachment['width'] . '" height="' $attachment['height'] . '" border="0" /><br />';
}
echo '
<a href="' 
$attachment['href'] . '"><img src="' $settings['images_url'] . '/icons/clip.gif" align="middle" alt="*" border="0" />&nbsp;' $attachment['name'] . '</a> ';

if (!$attachment['is_approved'])
echo '
[<a href="'
$scripturl'?action=attachapprove;sa=approve;aid='$attachment['id'], ';sesc='$context['session_id'], '">'$txt['approve'], '</a>]&nbsp;|&nbsp;[<a href="'$scripturl'?action=attachapprove;sa=reject;aid='$attachment['id'], ';sesc='$context['session_id'], '">'$txt['delete'], '</a>] ';
echo '
('
$attachment['size'], ($attachment['is_image'] ? ', ' $attachment['real_width'] . 'x' $attachment['real_height'] . ' - ' $txt['attach_viewed'] : ' - ' $txt['attach_downloaded']) . ' ' $attachment['downloads'] . ' ' $txt['attach_times'] . '.)<br />';
}

// If we had unapproved attachments clean up.
if ($last_approved_state == 0)
echo '
</fieldset>'
;

echo '
</div>'
;
}

if(!empty($message['disabled_attachments']))
{
echo '
<hr width="100%" size="1" class="hrcolor" />
<div style="overflow: auto; width: 100%;">
<span class="smalltext" style="color:#FF0000">'
,sprintf($txt['num_disabled_attachments'],$message['num_disabled_attachments']),'</span>';
foreach($message['disabled_attachments'] as $attachment)
echo '<div style="color:#FF0000"><a href="http://www.pinoytambaygroup.com/forum/index.php?action=register"><img src="http://www.pinoytambaygroup.com/forum/Themes/outline20b3/images/post/clip.gif">',$attachment['filename'],'</a></div>';
echo '</div>';
}
echo '
</td>
</tr><tr>
<td valign="bottom" class="smalltext" id="modified_'
$message['id'], '">';

// Show "« Last Edit: Time by Person »" if this post was edited.
if ($settings['show_modify'] && !empty($message['modified']['name']))
echo '
&#38;#38;#171; <i>'
$txt['last_edit'], ': '$message['modified']['time'], ' '$txt['by'], ' '$message['modified']['name'], '</i> &#38;#38;#187;';

echo '
</td>
<td align="'
, !$context['right_to_left'] ? 'right' 'left''" valign="bottom" class="smalltext">';

// Maybe they want to report this post to the moderator(s)?
if ($context['can_report_moderator'])
echo '
<a href="'
$scripturl'?action=reporttm;topic='$context['current_topic'], '.'$message['counter'], ';msg='$message['id'], '">'$txt['report_to_mod'], '</a> &nbsp;';

// Can we issue a warning because of this post?  Remember, we can't give guests warnings.
if ($context['can_issue_warning'] && !$message['is_message_author'] && !$message['member']['is_guest'])
echo '
<a href="'
$scripturl'?action=profile;u='$message['member']['id'], ';sa=issueWarning;msg='$message['id'], '"><img src="'$settings['images_url'], '/warn.gif" alt="'$txt['issue_warning_post'], '" title="'$txt['issue_warning_post'], '" border="0" /></a>';
echo '
<img src="'
$settings['images_url'], '/ip.gif" alt="" border="0" />';

// Show the IP to this user for this post - because you can moderate?
if ($context['can_moderate_forum'] && !empty($message['member']['ip']))
echo '
<a href="'
$scripturl'?action=trackip;searchip='$message['member']['ip'], '">'$message['member']['ip'], '</a> <a href="'$scripturl'?action=helpadmin;help=see_admin_ip" onclick="return reqWin(this.href);" class="help">(?)</a>';
// Or, should we show it because this is you?
elseif ($message['can_see_ip'])
echo '
<a href="'
$scripturl'?action=helpadmin;help=see_member_ip" onclick="return reqWin(this.href);" class="help">'$message['member']['ip'], '</a>';
// Okay, are you at least logged in?  Then we can show something about why IPs are logged...
elseif (!$context['user']['is_guest'])
echo '
<a href="'
$scripturl'?action=helpadmin;help=see_member_ip" onclick="return reqWin(this.href);" class="help">'$txt['logged'], '</a>';
// Otherwise, you see NOTHING!
else
echo '
'
$txt['logged'];

echo '
</td>
</tr></table>'
;

// Show the member's signature?
if (isset($modSettings['arrange_hsfg']) && ($modSettings['arrange_hsfg'] && ($context['user']['is_guest'])))
{
echo '
<hr width="100%" size="1" class="hrcolor" />
<center>'
$txt['hide_signature'], '&nbsp;<a href="'$scripturl'?action=register">' $txt['register'] , '</a>&nbsp;'$txt['hide_signature_or'], '&nbsp;<a href="'$scripturl'?action=login">' $txt['login'] , '</a></center>';
}
else
{
if (!empty($message['member']['signature']) && empty($options['show_no_signatures']) && $context['signature_enabled'])
echo '
<hr width="100%" size="1" class="hrcolor" />
<div class="signature">'
$message['member']['signature'], '</div>';
}


echo '
</td>
</tr>





<!-- google_ad_section_end -->



</table>
</td></tr>
</table>
</td></tr>'
;
}
echo '
<tr><td style="padding: 0 0 1px 0;"></td></tr>
</table>
<a name="lastPost"></a>'
;

// As before, build the custom button right.
if ($context['can_add_poll'])
$normal_buttons['custom'] = array('text' => 'add_poll''image' => 'add_poll.gif''lang' => true'url' => $scripturl '?action=editpoll;add;topic=' $context['current_topic'] . '.' $context['start'] . ';sesc=' $context['session_id']);
elseif ($context['user']['is_logged'] && $settings['show_mark_read'])
$normal_buttons['custom'] = array('text' => 'mark_unread''image' => 'markunread.gif''lang' => true'url' => $scripturl '?action=markasread;sa=topic;t=' $context['mark_unread_time'] . ';topic=' $context['current_topic'] . '.' $context['start'] . ';sesc=' $context['session_id']);

echo '
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="middletext">'
$txt['pages'], ': '$context['page_index'], !empty($modSettings['topbottomEnable']) ? $context['menu_separator'] . ' &nbsp;&nbsp;<a href="#top"><b>' $txt['go_up'] . '</b></a>' '''</td>
<td align="right" style="padding-right: 1ex;">
<table cellpadding="0" cellspacing="0">
<tr>
'
template_button_strip($normal_buttons'top'true), '
</tr>
</table>
</td>
</tr>
</table>

<table border="0" width="100%" cellpadding="0" cellspacing="0" style="margin-bottom: 1ex;">
<tr>'
;
if ($settings['linktree_inline'])
echo '
<td valign="top">'
theme_linktree(), '</td> ';
echo '
<td valign="top" align="'
, !$context['right_to_left'] ? 'right' 'left''" class="nav"> '$context['previous_next'], '</td>
</tr>
</table>'
;

$mod_buttons = array(
'move' => array('test' => 'can_move''text' => 'move_topic''image' => 'admin_move.gif''lang' => true'url' => $scripturl '?action=movetopic;topic=' $context['current_topic'] . '.0'),
'delete' => array('test' => 'can_delete''text' => 'remove_topic''image' => 'admin_rem.gif''lang' => true'custom' => 'onclick="return confirm(\'' $txt['are_sure_remove_topic'] . '\');"''url' => $scripturl '?action=removetopic2;topic=' $context['current_topic'] . '.0;sesc=' $context['session_id']),
'lock' => array('test' => 'can_lock''text' => empty($context['is_locked']) ? 'set_lock' 'set_unlock''image' => 'admin_lock.gif''lang' => true'url' => $scripturl '?action=lock;topic=' $context['current_topic'] . '.' $context['start'] . ';sesc=' $context['session_id']),
'sticky' => array('test' => 'can_sticky''text' => empty($context['is_sticky']) ? 'set_sticky' 'set_nonsticky''image' => 'admin_sticky.gif''lang' => true'url' => $scripturl '?action=sticky;topic=' $context['current_topic'] . '.' $context['start'] . ';sesc=' $context['session_id']),
'merge' => array('test' => 'can_merge''text' => 'merge''image' => 'merge.gif''lang' => true'url' => $scripturl '?action=mergetopics;board=' $context['current_board'] . '.0;from=' $context['current_topic']),
'remove_poll' => array('test' => 'can_remove_poll''text' => 'poll_remove''image' => 'admin_remove_poll.gif''lang' => true'custom' => 'onclick="return confirm(\'' $txt['poll_remove_warn'] . '\');"''url' => $scripturl '?action=removepoll;topic=' $context['current_topic'] . '.' $context['start']),
'calendar' => array('test' => 'calendar_post''text' => 'calendar_link''image' => 'linktocal.gif''lang' => true'url' => $scripturl '?action=post;calendar;msg=' $context['topic_first_message'] . ';topic=' $context['current_topic'] . '.0;sesc=' $context['session_id']),
);

if ($context['can_remove_post'] && !empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1)
$mod_buttons[] = array('text' => 'quickmod_delete_selected''image' => 'delete_selected.gif''lang' => true'custom' => 'onclick="return confirm(\'' $txt['quickmod_confirm'] . '\');" id="quickmodSubmit"''url' => 'javascript:document.quickModForm.submit();');

// Restore topic. eh?  No monkey business.
if (!empty($modSettings['recycle_enable']) && $context['current_board'] == $modSettings['recycle_board'] && $context['can_restore_topic'])
$mod_buttons[] = array('text' => 'restore_topic''image' => '''lang' => true'url' => $scripturl '?action=restoretopic;topic=' $context['current_topic'] . ';sesc=' $context['session_id']);

echo '
<table cellpadding="0" cellspacing="0" border="0" style="margin-left: 1ex;">
<tr>
'
template_button_strip($mod_buttons'bottom') , '
</tr>
</table>'
;


Metal_13

is this the code i should be editing?
its different from the line ... can u pls check....


// Show the post itself, finally!
echo '
</div></td>
</tr></table>
<hr width="100%" size="1" class="hrcolor" />';
if ($ignoring)
echo ' <div id="msg_', $message['id'], '_ignored_prompt" style="display: none;">', $txt['ignoring_user'], '  <a href="#msg', $message['id'], '" onclick="return ignoreToggles[', $message['id'], '].toggle()">', $txt['show_ignore_user_post'], '</a></div>';

echo '
<div class="post" id="msg_', $message['id'], '"', '>';

if (!$message['approved'] && $message['member']['id'] != 0 && $message['member']['id'] == $context['user']['id'])
echo '
<div style="margin: 2ex; padding: 1ex; border: 2px dashed #cc3344; color: black; font-weight: bold;">
', $txt['post_awaiting_approval'], '
</div>';
echo '
', $message['body'], '
</div>', $message['can_modify'] ? '
<img src="' . $settings['images_url'] . '/icons/modify_inline.gif" alt="' . $txt['quick_modify'] . '" title="' . $txt['quick_modify'] . '" align="right" id="modify_button_' . $message['id'] . '" style="cursor: ' . ($context['browser']['is_ie5'] || $context['browser']['is_ie5.5'] ? 'hand' : 'pointer') . '; display: none;" onclick="oQuickModify.modifyMsg(\'' . $message['id'] . '\', \'' . $context['session_id'] . '\')" />' : '' , '
</td>
<!-- google_ad_section_end -->
</tr>';

Bulakbol

You didn't tell me what theme you are using or version of smf that's why I assumed it's the default core theme.

All Display.template.php of any theme has this
', $message['body'],
so if you can't find the whole line, pick a variable and you'll find the line in your custom theme.
Please do not PM me for support · My Mods and Theme · SMF Coding Guidelines · Modifications Approval Guidelines

Metal_13

thanks man.. it worked.. but how about after the first post? i tried playing with the code but all i get is errors.....
can u give the code for it? same thing... ads on the first post but under the $message['body']

Bulakbol

#6
If you want ad on the top of the first message but on the bottom for the rest then in Display.template.php look for

Quoteecho '
                        ', $message['body'], '
                     </div>', $message['can_modify'] ? '

and replace with
Quoteif ($message['id'] == $context['first_message'])
                        echo '<div align="center">Place your Ads here</div>';
      echo '
                        ', $message['body'], '
                     </div>';
                     if ($message['id'] != $context['first_message'])
                        echo '<div align="center">Place your Ads here</div>';
                     echo $message['can_modify'] ? '


<edit>
For the bottom only of the first post.
Quoteecho '
                        ', $message['body'];
                        if ($message['id'] == $context['first_message'])
                        echo '<div align="center">Place your Ads here</div>';
                      echo '
                     </div>', $message['can_modify'] ? '
</edit>
Please do not PM me for support · My Mods and Theme · SMF Coding Guidelines · Modifications Approval Guidelines

Metal_13

i just wish theres a way to thank u...  :D
Thanks man...

Bulakbol

Please do not PM me for support · My Mods and Theme · SMF Coding Guidelines · Modifications Approval Guidelines

Advertisement: