Author |
Message |
vicgolgo13
New Member


Joined: Dec 08, 2004
Posts: 2
Location: Chicago, IL
|
Posted:
Wed Dec 08, 2004 5:59 pm |
|
I found an interesting little bug here and want to see if anyone else got this too.
In the file: modules/Your_Account/includes/ui-0privmsgs.php , it seems that the following code is not pulling the neccessary information:
Code:
$configresult = $db->sql_query("SELECT config_name, config_value FROM ".$prefix."_bbconfig");
while (list($config_name, $config_value) = $db->sql_fetchrow($configresult)) {
$bbconfig[$config_name] = $config_value;
}
$bbstyle = $bbconfig['default_style'];
$sql = "SELECT template_name FROM nuke_bbthemes WHERE themes_id='$bbstyle'";
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$bbtheme = $row[template_name];
|
I tried plugging this into a separate page and echoed out $bbstyle and $bbtheme and found that $bbstyle outputted 0 everytime.
All that this is doing is causing the images in the Private messages block within a user's view of Your_Account to not show.
- v i c - |
|
|
|
 |
menelaos61
Worker


Joined: Nov 10, 2004
Posts: 110
|
Posted:
Thu Dec 09, 2004 1:55 pm |
|
Thanks, vicgolgo13!
I'll investigate it.
Actually i want to make is use the current users theme icons for the private messages.
I'll report back when i'm done.
Cheers,
Richard |
|
|
|
 |
vicgolgo13

|
Posted:
Thu Dec 09, 2004 4:47 pm |
|
Yeah, I saw that bit of code too. I'm trying to work on a temporary workaround myself, and if I come up with anything I'll let you know. |
|
|
|
 |
MrFluffy
Hangin' Around

Joined: Jun 24, 2004
Posts: 28
Location: Berlin
|
Posted:
Fri Dec 10, 2004 5:35 pm |
|
As a workaround,
directly under
Code: $bbtheme = $row[template_name];
|
put
Code: if ($bbtheme == "") $bbtheme = "subSilver";
|
|
_________________ cu,
MrFluffy
Only registered users can see links on this board! Get registered or login! |
|
 |
 |
menelaos61

|
Posted:
Fri Dec 17, 2004 10:31 am |
|
Hi guys,
I have modified the code so that the current users theme icons will be used. If they are not available, the current forum template icons will be used.
In ui-0privmsgs.php
from // menelaos on replace the existing code with the folowing:Code: // menelaos61: function changed to reflect the private message icons that come with the theme or are in the default phpbb2 template
$configresult = $db->sql_query("SELECT config_name, config_value FROM ".$prefix."_bbconfig");
while (list($config_name, $config_value) = $db->sql_fetchrow($configresult)) {
$bbconfig[$config_name] = $config_value;
}
$bbstyle = $bbconfig['default_style'];
$sql = "SELECT template_name FROM ".$prefix."_bbthemes WHERE themes_id='$bbstyle'";
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$bbtheme = $row[template_name];
if ($imgpath == "") $imgpath = "subSilver";
$imgpath = "modules/Forums/templates/$bbtheme/images";
$ThemeSel = get_theme();
if (file_exists("themes/$ThemeSel/forums/images/msg_inbox.gif")) {
$imgpath = "themes/$ThemeSel/forums/images";
}
echo "<table border=\"0\" align=\"center\"><tr><td><b>"._YA_MESSAGES."</b></td></tr></table>\n";
echo "<table align=\"center\" border=\"0\"><tr align=\"center\">";
// echo "<td align=\"left\"><a href=\"messages.html\"><img src=\"$imgpath/whosonline.gif\" style=\"border:none;\"></a></td>";
// echo "<td valign=\"middle\"><a href=\"messages.html\"><b>"._YA_PM." : $ya_totpms</b></a><br></td><td width=\"%33\"> </td>\n";
echo "<td><a href=\"messages.html\"><img src=\"$imgpath/msg_inbox.gif\" style=\"border:none;\"></a></td>";
echo "<td valign=\"middle\"><a href=\"messages.html\"><b> "._YA_UNREAD.": $ya_newpms</b></a></td><td width=\"%33\"> </td>\n";
echo "<td><a href=\"messages.html\"><img src=\"$imgpath/msg_inbox.gif\" style=\"border:none;\"></a></td>";
echo "<td valign=\"middle\"><a href=\"messages.html\"><b> "._YA_READ.": $ya_oldpms</b></a></td><td width=\"%33\"> </td>\n";
echo "<td><a href=\"modules.php?name=Private_Messages&file=index&folder=savebox\"><img src=\"$imgpath/msg_savebox.gif\" style=\"border:none;\"></a></td>";
echo "<td valign=\"middle\"><a href=\"modules.php?name=Private_Messages&file=index&folder=savebox\"><b> "._YA_SAVED.": $ya_savpms</b></a></td>\n";
echo "<td width=\"%33\"> </td><td><a href=\"modules.php?name=Private_Messages&file=index&folder=outbox\"><img src=\"$imgpath/msg_outbox.gif\" style=\"border:none;\"></a></td>";
echo "<td valign=\"middle\"><a href=\"modules.php?name=Private_Messages&file=index&folder=outbox\"><b> "._YA_OUTBOX.": $ya_outpms</b></a></td></tr>\n";
echo "</table>\n";
echo "<table border=\"0\" align=\"center\"><tr>\n";
echo "<td width=\"45%\" align=\"right\"><form action=\"modules.php?name=Private_Messages&mode=post&pm_uname=$pm_uname\" method=\"post\">"._USENDPRIVATEMSG.":</td>";
echo "<td align=\"center\"><input type=\"text\" name=\"pm_uname\" size=\"20\"></td>";
echo "<td width=\"45%\" align=\"left\" valign=\"middle\">$links<input type=\"hidden\" name=\"send\" value=\"1\">";
echo "</td></form></tr></table>";
CloseTable();
}
?>
|
Cheers,
RIchard |
|
|
|
 |
JRSweets
Worker


Joined: Aug 06, 2004
Posts: 192
|
Posted:
Sat Dec 18, 2004 2:59 pm |
|
The langage defintions for _YA_MESSAGES, YA_READ, YA_UNREAD, YA_OUTBOX are not in the lang_english.php file. |
|
|
|
 |
MrFluffy

|
Posted:
Sat Dec 18, 2004 3:26 pm |
|
Remove the underscores in between (_YAMESSAGES, _YAUNREAD...) |
|
|
|
 |
sixonetonoffun
Spouse Contemplates Divorce

Joined: Jan 02, 2003
Posts: 2496
|
Posted:
Sun Dec 19, 2004 12:32 pm |
|
To really do this right change like this starting from line 26:
Code:
if (is_active("Private_Messages") AND ($username == $cookie[1]) AND ($usrinfo['user_password'] == $cookie[2])) {
echo "<br>";
OpenTable();
if (is_active("Members_List")) {
$mem_list = "<a href=\"members.html\">"._BROWSEUSERS."</a>";
} else {
$mem_list = "";
}
if (is_active("Search")) {
$mod_search = "<a href=\"modules.php?name=Search&type=users\">"._SEARCHUSERS."</a>";
} else {
$mod_search = "";
}
if ($mem_list != "" AND $mod_search != "") { $a = " | "; } else { $a = ""; }
if ($mem_list != "" OR $mod_search != "") {
$links = "[ $mem_list $a $mod_search ]";
} elseif ($mem_list == "" AND $mod_search == "") {
$links = "";
}
$ya_memname = htmlspecialchars($username);
list($uid) = $db->sql_fetchrow($db->sql_query("select user_id from ".$user_prefix."_users where username='$ya_memname'"));
$uid = intval($uid);
$ya_newpms = $db->sql_numrows($db->sql_query("select privmsgs_to_userid from ".$prefix."_bbprivmsgs where privmsgs_to_userid='$uid' and (privmsgs_type='1' OR privmsgs_type='5')"));
$ya_savpms = $db->sql_numrows($db->sql_query("select privmsgs_to_userid from ".$prefix."_bbprivmsgs where privmsgs_to_userid='$uid' and privmsgs_type='3'"));
$ya_oldpms = $db->sql_numrows($db->sql_query("select privmsgs_to_userid from ".$prefix."_bbprivmsgs where privmsgs_to_userid='$uid' and privmsgs_type='0'"));
$ya_outpms = $db->sql_numrows($db->sql_query("select privmsgs_from_userid from ".$prefix."_bbprivmsgs where privmsgs_to_userid='$uid'and privmsgs_type='1'"));
$ya_newpms = intval($ya_newpms);
$ya_oldpms = intval($ya_oldpms);
$ya_savpms = intval($ya_savpms);
$ya_totpms = $ya_newpms + $ya_oldpms + $ya_savpms;
$ya_totpms = intval($ya_totpms);
$pm_uname = htmlspecialchars($ya_memname);
// menelaos61: function changed to reflect the private message icons that come with the theme or are in the default phpbb2 template
$configresult = $db->sql_query("SELECT config_name, config_value FROM ".$prefix."_bbconfig");
while (list($config_name, $config_value) = $db->sql_fetchrow($configresult)) {
$bbconfig[$config_name] = $config_value;
}
$bbstyle = $bbconfig['default_style'];
$sql = "SELECT template_name FROM ".$prefix."_bbthemes WHERE themes_id='$bbstyle'";
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$bbtheme = $row['template_name'];
if ($bbtheme == "") {$bbtheme = "subSilver";} // Mrfluffy Fix
$imgpath = ""; // Security fix PSL
$imgpath = "modules/Forums/templates/$bbtheme/images";
$ThemeSel = get_theme();
if (file_exists("themes/$ThemeSel/forums/images/msg_inbox.gif")) {
$imgpath = "themes/$ThemeSel/forums/images";
}
echo "<table border=\"0\" align=\"center\"><tr><td><b>"._YA_MESSAGES."</b></td></tr></table>\n";
echo "<table align=\"center\" border=\"0\"><tr align=\"center\">";
// echo "<td align=\"left\"><a href=\"messages.html\"><img src=\"$imgpath/whosonline.gif\" style=\"border:none;\"></a></td>";
// echo "<td valign=\"middle\"><a href=\"messages.html\"><b>"._YA_PM." : $ya_totpms</b></a><br></td><td width=\"%33\"> </td>\n";
echo "<td><a href=\"messages.html\"><img src=\"$imgpath/msg_inbox.gif\" style=\"border:none;\"></a></td>";
echo "<td valign=\"middle\"><a href=\"messages.html\"><b> "._YA_UNREAD.": $ya_newpms</b></a></td><td width=\"%33\"> </td>\n";
echo "<td><a href=\"messages.html\"><img src=\"$imgpath/msg_inbox.gif\" style=\"border:none;\"></a></td>";
echo "<td valign=\"middle\"><a href=\"messages.html\"><b> "._YA_READ.": $ya_oldpms</b></a></td><td width=\"%33\"> </td>\n";
echo "<td><a href=\"modules.php?name=Private_Messages&file=index&folder=savebox\"><img src=\"$imgpath/msg_savebox.gif\" style=\"border:none;\"></a></td>";
echo "<td valign=\"middle\"><a href=\"modules.php?name=Private_Messages&file=index&folder=savebox\"><b> "._YA_SAVED.": $ya_savpms</b></a></td>\n";
echo "<td width=\"%33\"> </td><td><a href=\"modules.php?name=Private_Messages&file=index&folder=outbox\"><img src=\"$imgpath/msg_outbox.gif\" style=\"border:none;\"></a></td>";
echo "<td valign=\"middle\"><a href=\"modules.php?name=Private_Messages&file=index&folder=outbox\"><b> "._YA_OUTBOX.": $ya_outpms</b></a></td></tr>\n";
echo "</table>\n";
echo "<table border=\"0\" align=\"center\"><tr>\n";
echo "<td width=\"45%\" align=\"right\"><form action=\"modules.php?name=Private_Messages&mode=post&pm_uname=$pm_uname\" method=\"post\">"._USENDPRIVATEMSG.":</td>";
echo "<td align=\"center\"><input type=\"text\" name=\"pm_uname\" size=\"20\"></td>";
echo "<td width=\"45%\" align=\"left\" valign=\"middle\">$links<input type=\"hidden\" name=\"send\" value=\"1\">";
echo "</td></form></tr></table>";
CloseTable();
}
?>
|
|
_________________ [b][size=5]openSUSE 11.4-x86 | Linux 2.6.37.1-1.2desktop i686 | KDE: 4.6.41>=4.7 | XFCE 4.8 | AMD Athlon(tm) XP 3000+ | MSI K7N2 Delta-L | 3GB Black Diamond DDR
| GeForce 6200@433Mhz 512MB | Xorg 1.9.3 | NVIDIA 270.30[/size:2b8 |
|
|
 |
|