2006-03-27, 04:22 AM
2006-03-27, 08:17 AM
Or maybe on the index page?
2006-03-28, 04:41 PM
Heloo there
open ./portal.php
find
above it add
then open
Admin CP > Templates >Modify / delete > Portal page templates > portal
find
below it add
it will look something as here
this will also refresh the portal each few secs, so u can see all the new posts.
take note that you cant post shouts from there, u can only see them
regards
open ./portal.php
find
eval("\$portal = \"".$templates->get("portal")."\";");
above it add
//shoutbox
if($action == "do_shout")
{
$query = $db->query("SELECT * FROM ".TABLE_PREFIX."shouts");
$count = $db->num_rows($query);
$startat = $count - 5;
$query = $db->query("SELECT * FROM ".TABLE_PREFIX."shouts ORDER BY dateline LIMIT $startat, 5");
$check = 0;
while($shout = $db->fetch_array($query))
{
$username = $shout['username'];
if($username == $mybb['username'])
{
$check++;
}
}
if($check >= 5)
{
eval("\$error = \"".$templates->get("shoutbox_error_flood")."\";");
outputpage($error);
}
else
{
$message = addslashes($message);
$dateline = time();
$ipaddress = $REMOTE_ADDR;
$query = $db->query("INSERT INTO ".TABLE_PREFIX."shouts VALUES ('','$mybb[uid]','$mybb[username]','$message','$dateline','$ipaddress')");
redirect("shoutbox.php", "Shout submitted.", $settings['bbname']." - Shoutbox");
}
}
elseif($action == "do_delete")
{
$db->query("DELETE FROM ".TABLE_PREFIX."shouts WHERE sid='$sid'");
redirect("shoutbox.php", "Shout deleted.", $settings['bbname']." - Shoutbox");
}
elseif($action == "do_edit")
{
$message = addslashes($message);
$db->query("UPDATE ".TABLE_PREFIX."shouts SET message='$message' WHERE sid='$sid'");
redirect("shoutbox.php", "Shout edited.", $settings['bbname']." - Shoutbox");
}
elseif($action == "delete")
{
if(!$sid)
{
error("Invalid Shout", "Invalid shout.");
}
else
{
$query = $db->query("SELECT * FROM ".TABLE_PREFIX."shouts WHERE sid='$sid'");
$shout = $db->fetch_array($query);
if($mybb['uid'] != $shout['uid'] && $mybb['usergroup'] != 4 && $mybb['usergroup'] != 3)
{
nopermission();
}
eval("\$deleteshout = \"".$templates->get("shoutbox_deleteshout")."\";");
outputpage($deleteshout);
}
}
elseif($action == "edit")
{
if(!$sid)
{
error("Invalid Shout", "Invalid shout.");
}
else
{
$query = $db->query("SELECT * FROM ".TABLE_PREFIX."shouts WHERE sid='$sid'");
$shout = $db->fetch_array($query);
if($mybb['uid'] != $shout['uid'] && $mybb['usergroup'] != 4 && $mybb['usergroup'] != 3)
{
nopermission();
}
$shout['message'] = str_replace('"', '"', $shout['message']);
eval("\$editshout = \"".$templates->get("shoutbox_editshout")."\";");
outputpage($editshout);
}
}
else
{
if(!$page)
{
$page = 1;
}
$query = $db->query("SELECT * FROM ".TABLE_PREFIX."shouts");
$count = $db->num_rows($query);
$limit = 24;
$pages = $count / $limit;
$pages = ceil($pages);
if($count == 0)
{
eval("\$shouts = \"".$templates->get("shoutbox_error_noshouts")."\";");
}
$startat = $count - ($limit * $page);
if($page == $pages)
{
if($startat != 0)
{
$limit = $limit + $startat;
$startat = 0;
}
}
$query = $db->query("SELECT * FROM ".TABLE_PREFIX."shouts ORDER BY dateline LIMIT $startat, $limit");
while($shout = $db->fetch_array($query))
{
$shout['shouttime'] = mydate($settings['dateformat'], $shout['dateline']) . " " . mydate($settings['timeformat'], $shout['dateline']);
$query2 = $db->query("SELECT u.usergroup, g.* FROM ".TABLE_PREFIX."users u LEFT JOIN ".TABLE_PREFIX."usergroups g ON (g.gid=u.usergroup) WHERE u.uid='$shout[uid]'");
$group = $db->fetch_array($query2);
$shout['message'] = postify($shout['message']);
$mecheck = explode(" ", $shout['message']);
if($mecheck[0] == "/me" || $mecheck[0] == "/slap")
{
$shout['message'] = domecode($shout['message'], $shout['username']);
$shout['username'] = "";
}
else
{
$shout['username'] = formatname($shout['username'], $group['namestyle']);
$shout['username'] = "<<a href=\"member.php?action=profile&uid=$shout[uid]\">$shout[username]</a>>";
}
if($mybb['usergroup'] == 4 || $mybb['usergroup'] == 3)
{
$title = "title=\"Posted: $shout[shouttime], IP: $shout[ipaddress]\"";
}
else
{
$title = "title=\"Posted: $shout[shouttime]\"";
}
if($mybb['uid'] == $shout['uid'] || $mybb['usergroup'] == 4 || $mybb['usergroup'] == 3)
{
eval("\$options = \"".$templates->get("shoutbox_options")."\";");
}
else
{
$options = "";
}
if($bgcolor == "trow1")
{
$bgcolor = "trow2";
}
else
{
$bgcolor = "trow1";
}
eval("\$shouts .= \"".$templates->get("shoutbox_shout")."\";");
}
if($page != 1)
{
if($page == $pages)
{
$nextpage = $page - 1;
eval("\$next = \"".$templates->get("shoutbox_next")."\";");
}
else
{
$prevpage = $page + 1;
$nextpage = $page - 1;
eval("\$prev = \"".$templates->get("shoutbox_prev")."\";");
eval("\$next = \"".$templates->get("shoutbox_next")."\";");
}
}
else
{
if($pages > 1)
{
$prevpage = $page + 1;
eval("\$prev = \"".$templates->get("shoutbox_prev")."\";");
}
}
if($pages > 1)
{
eval("\$pageselect = \"".$templates->get("shoutbox_pages")."\";");
}
eval("\$submit = \"".$templates->get("shoutbox_submit")."\";");
$refresh = "<meta http-equiv=\"refresh\" content=\"60;URL=portal.php\">";
eval("\$shoutbox = \"".$templates->get("shoutbox")."\";");
}
then open
Admin CP > Templates >Modify / delete > Portal page templates > portal
find
$latestthread
below it add
<table cellspacing="0" cellpadding="0" border="0" width="100%">
<tr>
<td>
<table border="0" cellspacing="$theme[borderwidth]" cellpadding="$theme[tablespace]" width="100%">
<tr>
<td cellspacing="0" cellpadding="0" >
<span class="smalltext">
$shoutbox</span>
<div align="center">$shoutboxlink | </div>
</td>
</tr>
</table>
</td></tr></table>
<br />
it will look something as here
this will also refresh the portal each few secs, so u can see all the new posts.
take note that you cant post shouts from there, u can only see them
regards
2006-03-28, 09:12 PM
u rock man!!!! thats what i was looking for... thanx!!
2006-04-10, 10:11 PM
How many shouts it will show? Can I control the number of the latest shouts?
2006-04-10, 10:36 PM
in this shoutbox version is impossible, wait for the 2.0
2006-04-10, 11:08 PM
ok, thanx.
2006-04-11, 12:07 AM
Can it also be added on the index.php of my forum?
2006-04-11, 09:09 AM
Quote:How many shouts it will show? Can I control the number of the latest shouts?
it is the same settings for the mod it self.
Quote:Can it also be added on the index.php of my forum?
Use side boxes mod, and add the same php code to index.php, and the same html code in place described in the sideboxes mod
regards
2006-04-11, 09:23 AM
zaher1988 Wrote:Quote:How many shouts it will show? Can I control the number of the latest shouts?
it is the same settings for the mod it self.
regards
hehe, cool, I limited it to show only the last 10 shouts