Quote:
Originally Posted by mooecow
he just took the code im guessing and went about putting it in the FORUMHOME template and then took the redirection and put it in the head area
|
you have to put the redirection in the php as per intructions below (last)
This code below above the line towards the end in forum/index.php
// ### ALL DONE! SPIT OUT THE HTML AND LET'S GET OUTA HERE... ###
PHP Code:
$shouts = $DB_site->query("
SELECT s.*, u.username
FROM " . TABLE_PREFIX . "shout s
LEFT JOIN " . TABLE_PREFIX . "user u ON (u.userid = s.userid)
ORDER BY dateline " . $vboptions['shoutframeorder'] . ", shoutid " . $vboptions['shoutframeorder'] . " LIMIT " . $vboptions['shoutframeamount'] . "
");
while ($shout = $DB_site->fetch_array($shouts))
{
$shout['date'] = vbdate($vboptions['dateformat'], $shout['dateline']);
$shout['time'] = vbdate($vboptions['timeformat'], $shout['dateline']);
$shout['pagetext'] = parse_bbcode($shout['pagetext'], 'shoutbox');
if ($shout['userid'] == 0)
{
$shout['username'] = "<i>" . $vbpharse['guest'] . "</i>";
}
if (substr(strtolower($shout['pagetext']), 0, 3) == "/me")
{
$shout['pagetext'] = str_replace("/me ", "", $shout['pagetext']);
eval('$shoutbits .= "' . fetch_template('shoutbox_main_message_me') . '";');
}
else
{
eval('$shoutbits .= "' . fetch_template('shoutbox_main_message') . '";');
}
}
place this in forumhome before </head>
PHP Code:
<script language="javascript">
<!--
function validate(theform)
{
if (theform.message.value == "")
{
alert('$vbphrase[you_must_enter_a_shout]');
return false;
}
else
{
return true;
}
}
//-->
</script>
replace the iframe code in forumhome (below $navbar or where you have it) with:
PHP Code:
<!-- shoutbox -->
<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="$stylevar[tablewidth]" align="center">
<thead>
<tr>
<td class="tcat" colspan="2">
<a style="float:$stylevar[right]" href="#top" onclick="return toggle_collapse('forumhome_shoutbox')"><img id="collapseimg_forumhome_shoutbox" src="$stylevar[imgdir_button]/collapse_tcat$vbcollapse[collapseimg_forumhome_shoutbox].gif" alt="" border="0" /></a>
<if condition="$bbuserinfo[userid] > 0"> <a href="shoutbox.php?$session[sessionurl]"></if>Short Public Messages<if condition="$bbuserinfo[userid] > 0"> </a></if> <if condition="$bbuserinfo[userid] > 0"> <form action="shoutbox.php" method="post" onsubmit="return validate(this);" name="shoutform">
<input type="hidden" name="s" value="$session[sessionhash]" />
<input type="hidden" name="do" value="insert" />
<input type="text" style="background-color:#DBDBDB;width:80;" name="message" id="message" value="" size="60" />
<input style="background-color:#DBDBDB;border:1px solid color:#C0C0C0;height:21px;"
type="submit" value="$vbphrase[shout]" class="button" />
</form> </if></td>
</tr>
</thead>
<tbody id="collapseobj_forumhome_shoutbox" style="$vbcollapse[collapseobj_forumhome_shoutbox]">
<tr>
<td class="alt1" width="100%">
$shoutbits
</td>
</tr>
</tbody>
</table>
<!-- end shoutbox -->
replace your shoutbox_main_message template with:
PHP Code:
<div class="smallfont">[$shout[date] <span class="time">$shout[time]</span>] <strong>$shout[username]:</strong>-
$shout[pagetext]</div>
I got it set in admincp to display only one shout. If you want to display more, place:
<div style="height:30px; width:100%; overflow:auto;"> in forumfome shoutbox code before $shoutbits and that will add a scrollbar. And then goodbye iframe.
And don't forget in shoutbox.php to replace the redirection.
PHP Code:
// insert into the database
$DB_site->query("INSERT INTO " . TABLE_PREFIX . "shout
(userid, dateline, pagetext)
VALUES
($bbuserinfo[userid], " . TIMENOW . ", '" . addslashes($pagetext) . "')
");
$shoutid = $DB_site->insert_id();
header("Location: http://yoursite.com/forums");
exit;
The same thing can be done with homepage, by simply inserting the code in there.
And the other guy wants to make people pay for this????