use images instead of the standard text link showing the private message info
Category: PHP Questions | 0 views | Add a Comment
This is what I have there now, 3.0.4, subsilver2:
S_USER_LOGGED_IN –>
<!– IF S_DISPLAY_PM –> <a href="{U_PRIVATEMSGS}"><img src="{T_THEME_PATH}/images/icon_mini_message.gif" width="12" height="13" alt="*" /> {PRIVATE_MESSAGE_INFO}<!– IF PRIVATE_MESSAGE_INFO_UNREAD –>, {PRIVATE_MESSAGE_INFO_UNREAD}<!– ENDIF –></a><!– ENDIF –>
————————————————————————————
This is the only info I found, and was told it would not work with the 3.0.4 version. I believe the one below is for version 2.0.
If you want to use images instead of the standard text link showing the private message info in your forum header you will have to create two gif images. Name them pm_no_new_msg.gif and pm_new_msg.gif. Upload those to ./templates/your_template_name/images.
Next you will have to make the following edits:
#——[ OPEN ]—————————-
#
./templates/your_template_name/overall_header.tpl
#
#——[ FIND ]—————————-
#
<a href="{U_PRIVATEMSGS}" class="mainmenu"><img src="templates/your_template_name/images/icon_mini_message.gif" width="12" height="13" border="0" alt="{PRIVATE_MESSAGE_INFO}" hspace="3" />{PRIVATE_MESSAGE_INFO}</a>
#
#——[ REPLACE WITH ]——————–
#
<a href="{U_PRIVATEMSGS}" class="mainmenu"><img src="{PRIVMSG_IMG}" alt="{PRIVATE_MESSAGE_INFO}" hspace="3" />{PRIVATE_MESSAGE_INFO}</a>
#
#——[ OPEN ]—————————-
#
./templates/your_template_name/your_template_name.cfg
#
#——[ FIND ]—————————-
#
$images[’pm_new_msg’] = "";
$images[’pm_no_new_msg’] = "";
#
#——[ REPLACE WITH ]——————–
#
$images[’pm_new_msg’] = "$current_template_images/pm_new_msg.gif";
$images[’pm_no_new_msg’] = "$current_template_images/pm_no_new_msg.gif";
If you want the new_pm.gif to show until all new PMs have been read instead of until the user enters his Inbox you have to make one additional edit:
#
#——[ OPEN ]—————————-
#
includes/page_header.php
#
#——[ FIND ]—————————-
#
if ( $userdata[’user_unread_privmsg’] )
{
$l_message_unread = ( $userdata[’user_unread_privmsg’] == 1 ) ? $lang[’Unread_pm’] : $lang[’Unread_pms’];
$l_privmsgs_text_unread = sprintf($l_message_unread, $userdata[’user_unread_privmsg’]);
}
#
#——[ REPLACE WITH ]—————————-
#
if ( $userdata[’user_unread_privmsg’] )
{
$l_message_unread = ( $userdata[’user_unread_privmsg’] == 1 ) ? $lang[’Unread_pm’] : $lang[’Unread_pms’];
$l_privmsgs_text_unread = sprintf($l_message_unread, $userdata[’user_unread_privmsg’]);
$icon_pm = $images[’pm_new_msg’];
}
PHP & 406 Not Acceptable
Category: PHP Questions | 0 views | Add a Comment
I have a litle problem with a script that I have create.
This script selecting from the database all the records (in total 2) and then print out a XML file.
I have enter this code to change the header to XML :
header(’Content-type: application/xml; charset="utf-8"’);
and then i print out hte records of the MySQL query :
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>";
echo "<languages>";
while($rows = @mysql_fetch_array($resLNGS, MYSQL_ASSOC))
{
echo "<lngs>";
if((isset($_POST[’lngs_id’]) && strlen($_POST[’lngs_id’])>0) && ($_POST[’lngs_id’] == $rows[’ID’]))
{
echo "<id default=\"" . $rows[’ID’] . "\">" . $rows[’ID’] . "</id>";
}
else
{
echo "<id>" . $rows[’ID’] . "</id>";
}
echo "<name>" . $rows[’NAME’] . "</name>";
echo "</lngs>";
}
echo "</languages>";
That’s all my code and then I’m getting from the server the following headers :
http://xx.x.xxx.xx/~babis08/CPanel/xml/languages.php
POST /~babis08/CPanel/xml/languages.php HTTP/1.1
Host: 62.1.216.81
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; el; rv:1.9.0.5) Gecko/2008120122 Firefox/3.0.5 FirePHP/0.2.1
Accept: application/xml, text/xml, */*
Accept-Language: el
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-7,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-alive
X-Requested-With: XMLHttpRequest
Referer: http://xx.x.xxx.xx/~babis08/CPanel/prop … insert.php
Cookie: PHPSESSID=4181110c8e9c2f68d7f758030aa2bbe4
Pragma: no-cache
Cache-Control: no-cache
HTTP/1.x 406 Not Acceptable
Date: Sat, 03 Jan 2009 08:22:17 GMT
Server: Apache/2.2.10 (Unix) mod_ssl/2.2.10 OpenSSL/0.9.8b mod_auth_passthrough/2.1 mod_bwlimited/1.4 FrontPage/5.0.2.2635 mod_perl/2.0.4 Perl/v5.8.8
Content-Length: 599
Keep-Alive: timeout=5, max=63
Connection: Keep-Alive
Content-Type: text/html; charset=iso-8859-1
What can i do for ? ? ?
thanks a lot
