News:

Want to get involved in developing SMF? Why not lend a hand on our GitHub!

Main Menu

smf versions without pm-email system

Started by lokasgr, November 27, 2012, 06:46:06 AM

Previous topic - Next topic

Kindred

emanuele,

I think that, if he removes the permissions for the SMF PMs (thus removing the menu and icons) AND removes the action from index.php, SMF won't do anything with the action and it may actually work.

sounds like the torrent tracker is a remarkably stupid piece of software though...
but then again, I think torrent is pretty stupid in general.... LOL!
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

lokasgr

its not!! i run years now torrent tracker, this is ideology and passion!
that all who use p2p have.
it is like disease. a virus in mind and blood.
except the part of coding.
the most nice part of p2p

Kindred

ummm... loka, I never said it IS stupid, I said that I think that it is.

Although, as I understand torrent and p2p exchanges in general, it is ideology and passion for illegally distributing other people's work without giving them fair compensation....   
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

emanuele

Quote from: lokasgr on November 27, 2012, 10:48:49 AM
i see.it  seems is very complicated because i don;t know what php files into main site calls the pm function to ripoff the smf link.
I'm confused by this ^^^

If the problem is that xbtit has a link to SMF's PM system it means someone put that link there and remove the action from index.php is "obviously" useless.
Of course then the issue is find where this link is added, but the person that should better know this is the one that created the bridge...also because without having the code in front is difficult to guess, very difficult...


Take a peek at what I'm doing! ;D




Hai bisogno di supporto in Italiano?

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non è una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.

Kindred

hmmm... again, a different interpretation of what he said...

I thought his statement was that the xbtit had its own pm system but that SMF "overpowered" the xbtit system. (so removing the smf action would allow xbtit to once again trigger its own system)

The OP is distinctly unclear in his requests and his explanations...
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

emanuele

Yep, at first I thought that too, but now I'm no more sure about it...

A link to some code would help much more than many amount of words. ;)


Take a peek at what I'm doing! ;D




Hai bisogno di supporto in Italiano?

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non è una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.

lokasgr

$usercptpl->set("MSG_LIST",false,true);
$usercptpl->set("MSG_READ",false,true);
$usercptpl->set("MSG_EDIT",false,true);
$usercptpl->set("MSG_MENU",false,true);
$usercptpl->set("PREVIEW",false,true);
$usercptpl->set("OUTBOX",(($_GET["what"]=="outbox")?true:false),true);

global $FORUMLINK, $db_prefix;

switch ($action)
{
    case 'post':
           $res=do_sqlquery("SELECT id FROM {$TABLE_PREFIX}users WHERE username=".sqlesc($_POST["receiver"]),true);
           if (!$res || mysql_num_rows($res)==0)
         {
               err_msg($language["ERROR"],$language["ERR_USER_NOT_FOUND"]);
               stdfoot();
               exit;
         }
           else
         {
               if ($_POST["confirm"]==$language["FRM_PREVIEW"])
           {
             $usercptpl->set("PREVIEW",true,true);
             $usercptpl->set("MSG_EDIT",true,true);

             $subject=$_POST["subject"];
             $receiver=$_POST["receiver"];
             $body=$_POST["msg"];

              if (empty($_POST["subject"]))
                $subject=$language["NO_SUBJECT"];

             $pmpreviewtpl=array();
             $pmpreviewtpl["subject"]=$subject;
             $pmpreviewtpl["body"]=  format_comment(unesc($_POST["msg"]));
             $usercptpl->set("pmpreview",$pmpreviewtpl);

             $pmedittpl=array();
             $pmedittpl["frm_action"]="index.php?page=usercp&do=".$do."&action=post&uid=".$uid."&what=".htmlspecialchars($what)."";
             $pmedittpl["receiver"]=$receiver;
             $pmedittpl["readonly"]=($what!="new" ? " readonly=\"readonly\"" : "");
             $pmedittpl["searchuser"]=($what=="new" ? "<a href=\"javascript:popusers('searchusers.php');\">".$language["FIND_USER"]."</a>" : "");
             $pmedittpl["subject"]=$subject;
             $pmedittpl["bbcode"]=textbbcode("edit","msg",$body);
             $pmedittpl["frm_preview"]="index.php?page=usercp&amp;do=".$do."&amp;action=post&amp;uid=".$uid."&amp;what=".htmlspecialchars($what)."&amp;preview=yes";
             $pmedittpl["frm_cancel"]="index.php?page=usercp&amp;uid=".$uid."&amp;do=pm&amp;action=list";
             $usercptpl->set("pmedit",$pmedittpl);
           }
               else
           {
             $result=mysql_fetch_array($res);
             $subject=sqlesc($_POST["subject"]);
             $msg=sqlesc($_POST["msg"]);
             $rec=$result["id"];
             $send=$CURUSER["uid"];

             if ($rec==1 || $rec==$send)
                stderr($language["ERROR"],$language["ERR_PM_GUEST"]);

             if ($subject=="''")
                $subject="'no subject'";

             send_pm($CURUSER['uid'],$rec,$subject, $msg);
             redirect("index.php?page=usercp&uid=".$uid."&do=pm&action=list");
             exit();
           }
         }
    break;

     case 'deleteall':
        if(substr($FORUMLINK,0,3)=="smf")
            redirect("index.php?page=forum&action=pm".(($_GET["type"]=="out")?";f=outbox":""));
        // MODIFIED DELETE ALL VERSION BY gAnDo
            if (isset($_GET["type"]))
                $what=$_GET["type"];
            else
                {
                redirect("index.php?page=usercp&uid=".$uid."&do=pm&action=list&what=".($what=="in"?"inbox":"outbox"));
                exit;
                }
                if($_GET["type"]=="out"){
           foreach($_POST["msg"] as $selected=>$msg)
           do_sqlquery("UPDATE {$TABLE_PREFIX}messages SET deletedBySender=1 WHERE id='".$msg."'",true);
           redirect("index.php?page=usercp&uid=".$uid."&do=pm&action=list&what=".($what=="in"?"inbox":"outbox"));
           exit();
        }
        else{
   foreach($_POST["msg"] as $selected=>$msg)
       do_sqlquery("DELETE FROM {$TABLE_PREFIX}messages WHERE id='".$msg."' AND readed='yes'",true);
       redirect("index.php?page=usercp&uid=".$uid."&do=pm&action=list&what=".($what=="in"?"inbox":"outbox"));
           exit();
        }

            break;

    case 'delete':
            if(substr($FORUMLINK,0,3)=="smf")
                redirect("index.php?page=forum&action=pm".(($_GET["type"]=="out")?";f=outbox":""));
            $id=intval($_GET["id"]);
            if($_GET["type"]=="out"){
do_sqlquery("UPDATE {$TABLE_PREFIX}messages SET deletedBySender=1 WHERE id='".$id."'",true);
            }else{
            do_sqlquery("DELETE FROM {$TABLE_PREFIX}messages WHERE receiver=".$uid." AND id=".$id." AND readed='yes'",true);
    }
            redirect("index.php?page=usercp&uid=".$uid."&do=pm&action=list&what=inbox");
            exit();
    break;

    case '':
    case 'change':
    default:
        if ($what=="outbox" && $action=="list")
          {
           $usercptpl->set("MSG_LIST",true,true);
           $pmoutboxtpl=array();
           $pmoutboxtpl["frm_action"]="index.php?page=usercp&amp;do=pm&amp;action=deleteall&amp;uid=".$uid."&amp;type=out";
           $usercptpl->set("pmbox",$pmoutboxtpl);

           if(substr($FORUMLINK,0,3)=="smf")
           {
               if($FORUMLINK=="smf")
                   $res=do_sqlquery("SELECT pm.ID_PM id, pmr.ID_MEMBER receiver, pm.msgtime added, pm.subject, pm.body msg, IF(pmr.is_read=0,'no','yes') readed, u.username receivername FROM {$db_prefix}personal_messages pm LEFT JOIN {$db_prefix}pm_recipients pmr ON pm.ID_PM=pmr.ID_PM LEFT JOIN {$TABLE_PREFIX}users u ON pmr.ID_MEMBER=u.smf_fid WHERE pm.ID_MEMBER_FROM=".$CURUSER["smf_fid"]." AND pm.deletedBySender!=1 ORDER BY added DESC",true);
               else
                   $res=do_sqlquery("SELECT `pm`.`id_pm` `id`, `pmr`.`id_member` `receiver`, `pm`.`msgtime` `added`, `pm`.`subject`, `pm`.`body` `msg`, IF(`pmr`.`is_read`=0,'no','yes') `readed`, `u`.`username` `receivername` FROM `{$db_prefix}personal_messages` `pm` LEFT JOIN `{$db_prefix}pm_recipients` `pmr` ON `pm`.`id_pm`=`pmr`.`id_pm` LEFT JOIN `{$TABLE_PREFIX}users` `u` ON `pmr`.`id_member`=`u`.`smf_fid` WHERE `pm`.`id_member_from`=".$CURUSER["smf_fid"]." AND `pm`.`deleted_by_sender`!=1 ORDER BY `added` DESC",true);
           }
           elseif($FORUMLINK=="ipb")
               header("Location: index.php?page=forum&action=pm");
           else
               $res=do_sqlquery("select m.*, IF(m.receiver=0,'System',u.username) as receivername FROM {$TABLE_PREFIX}messages m LEFT JOIN {$TABLE_PREFIX}users u on u.id=m.receiver WHERE sender=$uid AND deletedBySender=0 ORDER BY added DESC",true);
           if (!$res || mysql_num_rows($res)==0)
             {
                $usercptpl->set("NO_MESSAGES",true,true);
             }
           else
             {
            $pmouttpl=array();
            $i=0;
            $usercptpl->set("NO_MESSAGES",false,true);
                        while ($result=mysql_fetch_array($res))
                {
                $pmouttpl[$i]["readed"]=unesc($result["readed"]);
                $pmouttpl[$i]["senderid"]=($result["receiver"]==0||empty($result["receivername"])?"#":((substr($FORUMLINK,0,3)=="smf")?$BASEURL."/index.php?page=forum&action=profile;u=".$result["receiver"]:"index.php?page=userdetails&amp;id=".$result["receiver"]));
                $pmouttpl[$i]["sendername"]=unesc($result["receivername"]);
                $pmouttpl[$i]["added"]=get_date_time($result["added"]);
                $pmouttpl[$i]["pmlink"]=((substr($FORUMLINK,0,3)=="smf")?$BASEURL."/index.php?page=forum&amp;action=pm;f=outbox":"index.php?page=usercp&amp;do=pm&amp;action=read&amp;uid=".$uid."&amp;id=".$result["id"]."&amp;what=outbox");
                $pmouttpl[$i]["subject"]=format_comment(unesc($result["subject"]));
                $pmouttpl[$i]["msgid"]=$result["id"];
                $i++;
                }
            $usercptpl->set("pm",$pmouttpl);
             }
          }
        elseif ($what=="inbox" && $action=="list")
          {
           $usercptpl->set("MSG_LIST",true,true);
           $pminboxtpl=array();
           $pminboxtpl["frm_action"]="index.php?page=usercp&amp;do=pm&amp;action=deleteall&amp;uid=".$uid."&amp;type=in";
           $usercptpl->set("pmbox",$pminboxtpl);

           if(substr($FORUMLINK,0,3)=="smf")
           {
               if($FORUMLINK=="smf")
                   $res=do_sqlquery("SELECT `pm`.`ID_PM` `id`, `pm`.`ID_MEMBER_FROM` `sender`, `pmr`.`ID_MEMBER` `receiver`, `pm`.`msgtime` `added`, `pm`.`subject`, `pm`.`body` `msg`, IF(`pmr`.`is_read`=0,'no','yes') `readed`, `pm`.`fromName` `sendername` FROM `{$db_prefix}personal_messages` `pm` LEFT JOIN `{$db_prefix}pm_recipients` `pmr` ON `pm`.`ID_PM`=`pmr`.`ID_PM` WHERE `pmr`.`ID_MEMBER`=".$CURUSER["smf_fid"]." AND `pmr`.`deleted`!=1 ORDER BY `added` DESC",true);
               else
                   $res=do_sqlquery("SELECT `pm`.`id_pm` `id`, `pm`.`id_member_from` `sender`, `pmr`.`id_member` `receiver`, `pm`.`msgtime` `added`, `pm`.`subject`, `pm`.`body` `msg`, IF(`pmr`.`is_read`=0,'no','yes') `readed`, `pm`.`from_name` `sendername` FROM `{$db_prefix}personal_messages` `pm` LEFT JOIN `{$db_prefix}pm_recipients` `pmr` ON `pm`.`id_pm`=`pmr`.`id_pm` WHERE `pmr`.`id_member`=".$CURUSER["smf_fid"]." AND `pmr`.`deleted`!=1 ORDER BY `added` DESC",true);
           }
           elseif($FORUMLINK=="ipb")
               header("Location: index.php?page=forum&action=pm");
           else
               $res=do_sqlquery("select m.*, IF(m.sender=0,'System',u.username) as sendername FROM {$TABLE_PREFIX}messages m LEFT JOIN {$TABLE_PREFIX}users u on u.id=m.sender WHERE receiver=$uid ORDER BY added DESC",true);
           if (!$res || mysql_num_rows($res)==0)
             {
                $usercptpl->set("NO_MESSAGES",true,true);
             }
                   else
             {
                $pmintpl=array();
                $i=0;
                $usercptpl->set("NO_MESSAGES",false,true);
                while ($result=mysql_fetch_array($res))
        {
        $pmintpl[$i]["readed"]=unesc($result["readed"]);
        $pmintpl[$i]["senderid"]=($result["sender"]==0||empty($result["sendername"])?"#":((substr($FORUMLINK,0,3)=="smf")?$BASEURL."/index.php?page=forum&amp;action=profile;u=".$result["sender"]:"index.php?page=userdetails&amp;id=".$result["sender"]));
        $pmintpl[$i]["sendername"]=unesc($result["sendername"]);
        $pmintpl[$i]["added"]=get_date_time($result["added"]);
        $pmintpl[$i]["pmlink"]=((substr($FORUMLINK,0,3)=="smf")?$BASEURL."/index.php?page=forum&amp;action=pm":"index.php?page=usercp&amp;do=pm&amp;action=read&amp;uid=".$uid."&amp;id=".$result["id"]."&amp;what=inbox");
        $pmintpl[$i]["subject"]=format_comment(unesc($result["subject"]));
        $pmintpl[$i]["msgid"]=$result["id"];
        $i++;
        }
    $usercptpl->set("pm",$pmintpl);
       }
          }
        elseif ($what=="new" && $action=="edit" || $do == "pm" && $action == "edit")
  {
           if($FORUMLINK=="ipb")
               header("Location: index.php?page=forum&action=newpm&to=".(isset($_GET['to'])?htmlentities($_GET['to']):'')."");//insert name to ipb form.

   $usercptpl->set("MSG_EDIT",true,true);

           // if new pm will give id=0 and empty array
           if (isset($_GET['id']) && $_GET['id'])
                $id=intval(0+$_GET['id']);
           else $id=0;
           if (!isset($_GET['what'])) $_GET['what'] = '';
           if (!isset($_GET['to'])) $_GET['to'] = '';

           if (urldecode($_GET['to'])==$CURUSER["username"])
              stderr($language["ERROR"],$language["ERR_PM_GUEST"]);

           $res=do_sqlquery("select m.*, IF(m.sender=0,'System',u.username) as sendername FROM {$TABLE_PREFIX}messages m LEFT JOIN {$TABLE_PREFIX}users u on u.id=m.sender WHERE receiver=$uid AND m.id=$id",true);

           if (!$res)
             {                       
            err_msg($language["ERROR"],$language["BAD_ID"]);
            stdfoot();
            exit;
             }
           else
             {
            $result=mysql_fetch_array($res);
            $pmedittpl=array();
            $pmedittpl["frm_action"]="index.php?page=usercp&amp;do=".$do."&amp;action=post&amp;uid=".$uid."&amp;what=".htmlspecialchars($what)."";
            $pmedittpl["receiver"]=($what!="new" ? unesc($result["sendername"]):htmlspecialchars(urldecode($_GET["to"])));
            $pmedittpl["readonly"]=($what!="new" ? " readonly=\"readonly\"" : "");
            $pmedittpl["searchuser"]=($what=="new" ? "<a href=\"javascript:popusers('searchusers.php');\">".$language["FIND_USER"]."</a>" : "");
            $pmedittpl["subject"]=($what!="new" ? (strpos(unesc($result["subject"]), "Re:")===false?"Re:":"").unesc($result["subject"]):"");
            $pmedittpl["bbcode"]=textbbcode("edit","msg",($what=="quote" ? "[quote=".htmlspecialchars($result["sendername"])."]".unesc($result["msg"])."[/quote]" : ""));
            $pmedittpl["frm_preview"]="index.php?page=usercp&amp;do=".$do."&amp;action=post&amp;uid=".$uid."&amp;what=".htmlspecialchars($what)."";
            $pmedittpl["frm_cancel"]="index.php?page=usercp&amp;uid=".$uid."&amp;do=pm&amp;action=list";
            $usercptpl->set("pmedit",$pmedittpl);
             }
          }
        elseif ($what=="inbox" && $action=="read" || $what=="outbox" && $action=="read")
  {
   $usercptpl->set("MSG_READ",true,true);

           $id=intval($_GET["id"]);
           if ($what=="inbox")
              $res=do_sqlquery("select m.*, IF(m.sender=0,'System',u.username) as sendername FROM {$TABLE_PREFIX}messages m LEFT JOIN {$TABLE_PREFIX}users u on u.id=m.sender WHERE receiver=$uid AND m.id=$id",true);
           elseif ($what=="outbox")
               $res=do_sqlquery("select m.*, IF(m.receiver=0,'System',u.username) as sendername FROM {$TABLE_PREFIX}messages m LEFT JOIN {$TABLE_PREFIX}users u on u.id=m.receiver WHERE sender=$uid AND m.id=$id",true);

           if (mysql_num_rows($res) == "0")
             {
            err_msg($language["ERROR"],$language["BAD_ID"]);
            stdfoot();
            exit;
             }
           else
             {
            $result=mysql_fetch_array($res);
            $pmreadtpl=array();
            $pmreadtpl["sender_link"]="index.php?page=userdetails&amp;id=".$result["sender"]."";
            $pmreadtpl["sender_name"]=unesc($result["sendername"]);
            $pmreadtpl["added"]=get_date_time($result["added"]);
            $pmreadtpl["elapsed"]=get_elapsed_time($result["added"]);
            $pmreadtpl["comment"]=format_comment(unesc($result["subject"]));
            $pmreadtpl["body"]=format_comment(unesc($result["msg"]));

            if ($what=="inbox")
              {
                $usercptpl->set("MSG_MENU",true,true);
                $pmreadtpl["quote_link"]="location.href='index.php?page=usercp&amp;do=pm&amp;action=edit&amp;what=quote&amp;uid=".$uid."&amp;id=".$id."'";
                $pmreadtpl["answer_link"]="location.href='index.php?page=usercp&amp;do=pm&amp;action=edit&amp;uid=".$uid."&amp;id=".$id."'";
                $pmreadtpl["delete_link"]="location.href='index.php?page=usercp&amp;do=pm&amp;action=delete&amp;uid=".$uid."&amp;id=".$id."'";
                do_sqlquery("UPDATE {$TABLE_PREFIX}messages SET readed='yes' WHERE id=$id",true);
              }
            $usercptpl->set("pmread",$pmreadtpl);
             }
          }
    break;
}



here is a usercp.pmbox.php

it calls some tpl for links i want to say some idea if miss from code the call of smf?

Kindred

wait... emanuele was right.    that system *IS* using the SMF personal messages system.   there is no separate system.

So, I guess I (again) don't understand your problem.
That code that you included clearly tells the xbtit system to use the SMF personal messages.

Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

lokasgr

yes i know that,the point is tha is wrong, maybe the coder didn't thought that code separate the internal pm sytem or he in he mind was ok because pm system was worked.

Kindred

how is that wrong?  According to that code, there is no PM system in xbtit. It just reads form the SMF (or IPB) system
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

lokasgr

listen!! if we close the integrated forum automatic turns to xbtit pm system, but if we do this we loose the smf forum.
if we have the smf as we have it now if we want to write a pm we can write it from xbtit pm system when we open a pm opens in smf.

Kindred

yes, exactly correct...   because that code which you pasted tells it to do exactly that.

What I told you to do will shut down the SMF PM system completely. no permissions and no action...
However, the code that you included basically says, use the SMF PM system.

You will have to modify your xbtit integration file... I suggest that you check with the author of that file.
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

lokasgr

#32
lol they don't care about it, i can give you the code of integration mod if you like to see it.

or i must find those files on main script who calls smf and just delete it?


emanuele

Well, from what I can see you have to change a lot of things...but the only way is to change this and any other file that points/uses SMF pages and database (if I'm not wrong (and I'm currently a bit sick so I may be wrong) it does also some queries on SMF's database).


Take a peek at what I'm doing! ;D




Hai bisogno di supporto in Italiano?

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non è una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.

Advertisement: