|
#1
|
|||
|
|||
Avatar in Shoutbox
Hi guys,
i am working for add the avatar near the pseudo in shoutbox but i am a noob with SQL.. Please anyone can help me? PHP Code:
|
#2
|
||||
|
||||
wow thats off
PHP Code:
__________________
Do not ask me to help you work on your site that is not phpMyBitTorrent Do not ask me to make a mod for any other source Do not Ask me to setup your site. I will no longer help you setup your site, there is a setup script if you have trouble with it post in the forum here or in BT.Manager™ forum My Current Demo is here http://demo.btmanager.org/ |
The Following 2 Users Say Thank You to joeroberts For This Useful Post: | ||
Daz (27th February 2013),
psylodesign (22nd October 2011)
|
#3
|
|||
|
|||
i was sure than that's off ,
thx a lot it works perfect |
#4
|
|||
|
|||
Quote:
hint LEFT JOIN |
The Following User Says Thank You to putyn For This Useful Post: | ||
Daz (27th February 2013)
|
#5
|
|||
|
|||
So when u add your avatar to shoutbox will that slow your site down . As now you have to fetch it plus you will need to make your shoutbox even bigger ??
Call me crazy but ?:shock: |
#6
|
||||
|
||||
I like to use this to like so
PHP Code:
and as for enlarging you shout box all you would have to do is make the avatar a set size
__________________
Do not ask me to help you work on your site that is not phpMyBitTorrent Do not ask me to make a mod for any other source Do not Ask me to setup your site. I will no longer help you setup your site, there is a setup script if you have trouble with it post in the forum here or in BT.Manager™ forum My Current Demo is here http://demo.btmanager.org/ |
The Following User Says Thank You to joeroberts For This Useful Post: | ||
Daz (27th February 2013)
|
#7
|
||||
|
||||
This is very fine, but where to put it?
in shoutbox.php but where? |
#8
|
||||
|
||||
Quote:
Post your shoutbox.php here and please wrap it in php tags.
__________________
Can install Gazelle Last edited by firefly; 10th January 2013 at 18:51. |
#9
|
|||
|
|||
My thoughts exactly
|
#10
|
||||
|
||||
Quote:
Bump: Quote:
Code:
<?php // // TorrentTrader v2.x // $LastChangedDate: 2012-06-14 17:31:26 +0100 (Thu, 14 Jun 2012) $ // $LastChangedBy: torrenttrader $ // // http://www.torrenttrader.org // // require_once("backend/functions.php"); dbconn(false); ?> <body onload="document.getElementById('id_input').focus()"> <?php if ($site_config['SHOUTBOX']){ //DELETE MESSAGES if (isset($_GET['del'])){ if (is_numeric($_GET['del'])){ $query = "SELECT * FROM shoutbox WHERE msgid=".$_GET['del'] ; $result = SQL_Query_exec($query); }else{ echo "invalid msg id STOP TRYING TO INJECT SQL"; exit; } $row = mysql_fetch_row($result); if ($row && ($CURUSER["edit_users"]=="yes" || $CURUSER['username'] == $row[1])) { $query = "DELETE FROM shoutbox WHERE msgid=".$_GET['del'] ; write_log("<b><font color='orange'>Shout Deleted: </font> Deleted by ".$CURUSER['username']."</b>"); SQL_Query_exec($query); } } //INSERT MESSAGE if (!empty($_POST['message']) && $CURUSER) { $_POST['message'] = sqlesc($_POST['message']); $query = "SELECT COUNT(*) FROM shoutbox WHERE message=".$_POST['message']." AND user='".$CURUSER['username']."' AND UNIX_TIMESTAMP('".get_date_time()."')-UNIX_TIMESTAMP(date) < 30"; $result = SQL_Query_exec($query); $row = mysql_fetch_row($result); if ($row[0] == '0') { $query = "INSERT INTO shoutbox (msgid, user, message, date, userid) VALUES (NULL, '".$CURUSER['username']."', ".$_POST['message'].", '".get_date_time()."', '".$CURUSER['id']."')"; SQL_Query_exec($query); } } //GET CURRENT USERS THEME AND LANGUAGE if ($CURUSER){ $ss_a = @mysql_fetch_assoc(@SQL_Query_exec("select uri from stylesheets where id=" . $CURUSER["stylesheet"])); if ($ss_a) $THEME = $ss_a["uri"]; }else{//not logged in so get default theme/language $ss_a = mysql_fetch_assoc(SQL_Query_exec("select uri from stylesheets where id='" . $site_config['default_theme'] . "'")); if ($ss_a) $THEME = $ss_a["uri"]; } if(!isset($_GET['history'])){ ?> <html> <head> <title><?php echo $site_config['SITENAME'] . T_("SHOUTBOX"); ?></title> <?php /* If you do change the refresh interval, you should also change index.php printf(T_("SHOUTBOX_REFRESH"), 5) the 5 is in minutes */ ?> <meta http-equiv="refresh" content="300" /> <link rel="stylesheet" type="text/css" href="<?php echo $site_config['SITEURL']?>/themes/<?php echo $THEME; ?>/theme.css" /> <script type="text/javascript" src="<?php echo $site_config['SITEURL']; ?>/backend/java_klappe.js"></script> </head> <body class="shoutbox_body"> <?php echo '<div class="shoutbox_contain"><table border="0" style="width: 99%; table-layout:fixed">'; }else{ if ($site_config["MEMBERSONLY"]) { loggedinonly(); } stdhead(); begin_frame(T_("SHOUTBOX_HISTORY")); echo '<div class="shoutbox_history">'; $query = 'SELECT COUNT(*) FROM shoutbox'; $result = SQL_Query_exec($query); $row = mysql_fetch_row($result); echo '<div align="center">Pages: '; $pages = round($row[0] / 100) + 1; $i = 1; while ($pages > 0){ echo "<a href='".$site_config['SITEURL']."/shoutbox.php?history=1&page=".$i."'>[".$i."]</a> "; $i++; $pages--; } echo '</div><br /><table border="0" style="width: 99%; table-layout:fixed">'; } if (isset($_GET['history'])) { if (isset($_GET['page'])) { if($_GET['page'] > '1') { $lowerlimit = $_GET['page'] * 100 - 100; $upperlimit = $_GET['page'] * 100; }else{ $lowerlimit = 0; $upperlimit = 100; } }else{ $lowerlimit = 0; $upperlimit = 100; } $query = 'SELECT * FROM shoutbox ORDER BY msgid DESC LIMIT '.$lowerlimit.','.$upperlimit; }else{ $query = 'SELECT * FROM shoutbox ORDER BY msgid DESC LIMIT 20'; } $result = SQL_Query_exec($query); $alt = false; while ($row = mysql_fetch_assoc($result)) { if ($alt){ echo '<tr class="shoutbox_noalt">'; $alt = false; }else{ echo '<tr class="shoutbox_alt">'; $alt = true; } echo '<td style="font-size: 9px; width: 118px;">'; echo "<div align='left' style='float: left'>"; echo date('jS M, g:ia', utc_to_tz_time($row['date'])); echo "</div>"; if ( ($CURUSER["edit_users"]=="yes") || ($CURUSER['username'] == $row['user']) ){ echo "<div align='right' style='float: right'><a href='".$site_config['SITEURL']."/shoutbox.php?del=".$row['msgid']."' style='font-size: 8px'>[D]</a></div>"; } echo '</td><td style="font-size: 12px; padding-left: 5px"><a href="'.$site_config['SITEURL'].'/account-details.php?id='.$row['userid'].'" target="_parent"><b>'.$row['user'].':</b></a> '.nl2br(format_comment($row['message'])); echo '</td></tr>'; } ?> </table> </div> <br /> <?php //if the user is logged in, show the shoutbox, if not, dont. if(!isset($_GET['history'])) { if (isset($_COOKIE["pass"])){ echo "<form name='shoutboxform' action='shoutbox.php' method='post'>"; echo "<center><table width='100%' border='0' cellpadding='1' cellspacing='1'>"; echo "<tr class='shoutbox_messageboxback'>"; echo "<td width='75%' align='center'>"; echo "<input id='id_input' type='text' name='message' class='shoutbox_msgbox' />"; echo "</td>"; echo "<td>"; echo "<input type='submit' name='submit' value='".T_("SHOUT")."' class='shoutbox_shoutbtn' />"; echo "</td>"; echo "<td>"; echo '<a href="javascript:PopMoreSmiles(\'shoutboxform\', \'message\');"><small>'.T_("MORE_SMILIES").'</small></a>'; echo ' <small>-</small> <a href="javascript:PopMoreTags();"><small>'.T_("TAGS").'</small></a>'; echo "<br />"; echo "<a href='shoutbox.php'><small>".T_("REFRESH")."</small></a>"; echo " <small>-</small> <a href='".$site_config['SITEURL']."/shoutbox.php?history=1' target='_blank'><small>".T_("HISTORY")."</small></a>"; echo "</td>"; echo "</tr>"; echo "</table></center>"; echo "</form>"; }else{ echo "<br /><div class='shoutbox_error'>".T_("SHOUTBOX_MUST_LOGIN")."</div>"; } } if(!isset($_GET['history'])){ echo "</body></html>"; }else{ end_frame(); stdfoot(); } }//END IF $SHOUTBOX else{ echo T_("SHOUTBOX_DISABLED"); } ?> |
Tags |
avatar , shoutbox |
|
|