Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> CNB Your Account
Author Message
vicgolgo13
New Member
New Member



Joined: Dec 08, 2004
Posts: 2
Location: Chicago, IL

PostPosted: Wed Dec 08, 2004 5:59 pm Reply with quote

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 -
 
View user's profile Send private message Visit poster's website
menelaos61
Worker
Worker



Joined: Nov 10, 2004
Posts: 110

PostPosted: Thu Dec 09, 2004 1:55 pm Reply with quote

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
 
View user's profile Send private message Send e-mail
vicgolgo13







PostPosted: Thu Dec 09, 2004 4:47 pm Reply with quote

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

PostPosted: Fri Dec 10, 2004 5:35 pm Reply with quote

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! 
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger ICQ Number
menelaos61







PostPosted: Fri Dec 17, 2004 10:31 am Reply with quote

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."&nbsp;: &nbsp;$ya_totpms</b></a><br></td><td width=\"%33\">&nbsp;</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>&nbsp; "._YA_UNREAD.":&nbsp;$ya_newpms</b></a></td><td width=\"%33\">&nbsp;</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>&nbsp; "._YA_READ.":&nbsp;$ya_oldpms</b></a></td><td width=\"%33\">&nbsp;</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>&nbsp; "._YA_SAVED.":&nbsp;$ya_savpms</b></a></td>\n";
   echo "<td width=\"%33\">&nbsp;</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>&nbsp; "._YA_OUTBOX.":&nbsp;$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
Worker



Joined: Aug 06, 2004
Posts: 192

PostPosted: Sat Dec 18, 2004 2:59 pm Reply with quote

The langage defintions for _YA_MESSAGES, YA_READ, YA_UNREAD, YA_OUTBOX are not in the lang_english.php file.
 
View user's profile Send private message
MrFluffy







PostPosted: Sat Dec 18, 2004 3:26 pm Reply with quote

Remove the underscores in between Wink (_YAMESSAGES, _YAUNREAD...)
 
sixonetonoffun
Spouse Contemplates Divorce



Joined: Jan 02, 2003
Posts: 2496

PostPosted: Sun Dec 19, 2004 12:32 pm Reply with quote

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."&nbsp;: &nbsp;$ya_totpms</b></a><br></td><td width=\"%33\">&nbsp;</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>&nbsp; "._YA_UNREAD.":&nbsp;$ya_newpms</b></a></td><td width=\"%33\">&nbsp;</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>&nbsp; "._YA_READ.":&nbsp;$ya_oldpms</b></a></td><td width=\"%33\">&nbsp;</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>&nbsp; "._YA_SAVED.":&nbsp;$ya_savpms</b></a></td>\n";
   echo "<td width=\"%33\">&nbsp;</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>&nbsp; "._YA_OUTBOX.":&nbsp;$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 
View user's profile Send private message
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> CNB Your Account

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©