Tarih: 2005-09-28, 22:46:31 Mesaj konusu: Private_Messages ile alakali bir sorum olucak!!!!!
Selam arkadaslar benim bi sorunum var, asagiya eklemis oldugum kodda ozel mesajlari hep 0 olarak goruyor kodun neresinde yamuk var cikaramadim, normalde bu haliyle calisiyordu ne zamanki baska tema ile calismaya basladim calismaz oldu?
Eger yardimci olursaniz memnun olurum aslinda okunmus ve okunmamis mesajlari yan yana gosteren bir kod haline getirmek istedim ama malesef beceremedim asagidaki kod normalde sadece yeni prive mesaj geldiginde 1 numara yukseliyor normalde okundugu zaman sifirlamasi lazim ama prive message inboxta ne kadar mesaj varsa toplamini gosteriyor.
Kod:
if (is_user($user)) {
//$content .= "<br>"._YOUARELOGGED." <b>$uname</b>.<br>";
if (is_active("Private_Messages")) {
$sql = "SELECT user_id FROM ".$user_prefix."_users WHERE username='$uname'";
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$uid = $row[user_id];
$numrow = $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' OR privmsgs_type='0')"));
//$content .= ""._YOUHAVE." <a href=\"modules.php?name=Private_Messages\"><b>$numrow</b></a> "._PRIVATEMSG."";
}
//$content .= "</font></center>";
//} else {
//$content .= "<br>"._YOUAREANON."</font></center>";
CNB Your accounttaki gibi istiyorum aslinda, Siteye login oldugunda asagida gosteriyorya, message boxta kac mesaj var unread mesajlar kactane kac yeni mesajin var ona benzer bi sey yapmak istedim ama cikamadim. CNB nin kini editlemeye calistim oda olmadi. Asagiya CNB nin kodlarini ekliyorum onlar include olarak yapmislar.
Kod:
if (!eregi("modules.php", $_SERVER['SCRIPT_NAME'])) {
header("Location: ../../../index.php");
die ();
}
if (!defined('CNBYA')) { echo "CNBYA protection"; exit; }
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=\"modules.php?name=Members_List\">"._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);
$uid = intval($uid);
list($uid) = $db->sql_fetchrow($db->sql_query("select user_id from $user_prefix"._users." where username='$ya_memname'"));
$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_totpms = intval($ya_totpms);
$ya_newpms = intval($ya_newpms);
$ya_oldpms = intval($ya_oldpms);
$ya_savpms = intval($ya_savpms);
$ya_totpms = $ya_newpms + $ya_oldpms + $ya_savpms;
$pm_uname = htmlspecialchars($pm_uname);
// menelaos: function changed to reflect the default phpbb2 style icons (in a future version they will show the users phpnuke forum theme icons)
$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];
Bu forumda yeni başlıklar açamazsınız Bu forumdaki başlıklara cevap veremezsiniz Bu forumdaki mesajlarınızı değiştiremezsiniz Bu forumdaki mesajlarınızı silemezsiniz Bu forumdaki anketlerde oy kullanamazsınız