+ Reply to Thread
Results 1 to 8 of 8

Thread: help in invite topic function

  1. #1
    Senior Member icedroplet1987 is on a distinguished road
    Join Date
    Sep 2009
    Posts
    129
    Thanks
    4
    Thanked 0 Times in 0 Posts
    Rep Power
    1

    Default help in invite topic function

    hello friends, i have made this topic invite function.. but i am only able to select only 1 username to send invite.. but i want my users to send invite to multiple users by seperating username with comas in txtboz..
    Code:
    if($action=="sendinvi"){
    echo "<p align=\"left\">";
    $pmtou = $_POST["usn"];
    $who = getuid_nick($pmtou);
    $whonick = getnick_uid($who);
    addonline(getuid_sid($sid),"inviting users to topic","");
    $byuid = getuid_sid($sid);
    $tm = time();
    $pmtext = "txt";
    $dm = mysql_fetch_array(mysql_query("SELECT id FROM hfjgn_users WHERE name='".$unm."'"));
    $res = mysql_query("INSERT INTO hfjgn_private SET text='".$pmtext."', byuid='".$byuid."', touid='".$who."', timesent='".$tm."'");
    
    
    echo "<img src=\"images/ok.gif\" alt=\"O\"/>";
    echo "PM was sent successfully to $whonick<br/><br/>";
    echo parsepm($pmtext, $sid);
    echo "<br/><br/><a href=\"121inbox121.php?action=disp\">Back to MailBox</a><br/>";
    

  2. #2
    Senior Member djlee
    Join Date
    Jun 2008
    Posts
    257
    Thanks
    0
    Thanked 3 Times in 3 Posts
    Rep Power
    0

    Default

    PHP Code:
    if($action=="sendinvi"){
    echo 
    "<p align=\"left\">";
    $usrs explode(",",$_POST['usn']);
    $insert = array();
    addonline(getuid_sid($sid),"inviting users to topic","");
    $byuid getuid_sid($sid);
    $tm time();
    $pmtext "txt";

    foreach(
    $usrs as $pmtou)
     {
     
    $who getuid_nick($pmtou);
     
    $insert[] = "('".$pmtext."'"'".$byuid."','".$who."','".$tm."')";
     }



    $res = mysql_query("
    INSERT INTO hfjgn_private (text,byuid,touid,timesentVALUES ".implode(",",$insert));


    echo "
    <img src="images/ok.gif\" alt=\"O\"/>";
    echo 
    "PM was sent successfully to ".implode(", ",$usrs)."<br/><br/>";
    echo 
    parsepm($pmtext$sid);

    echo 
    "<br/><br/><a href=\"121inbox121.php?action=disp\">Back to MailBox</a><br/>"
    try something like that

  3. #3
    Senior Member icedroplet1987 is on a distinguished road
    Join Date
    Sep 2009
    Posts
    129
    Thanks
    4
    Thanked 0 Times in 0 Posts
    Rep Power
    1

    Default

    thnx to reply mate.. it shows that it sent msg to all users what we wrote but only sending to 1st username still.

  4. #4
    Senior Member djlee
    Join Date
    Jun 2008
    Posts
    257
    Thanks
    0
    Thanked 3 Times in 3 Posts
    Rep Power
    0

    Default

    since i dont use wap sources i cant test any of the code, the code is quite simple really , change

    Code:
    $res = mysql_query("INSERT INTO hfjgn_private (text,byuid,touid,timesent) VALUES ".implode(",",$insert));
    
    to

    Code:
    print("INSERT INTO hfjgn_private (text,byuid,touid,timesent) VALUES ".implode(",",$insert));
    
    In the code i gave and try it again, it should print out the sql statement, put that in this thread so i can have a look at wat the loop is producing, it should work as i use a similar method on another site for mass messaging

  5. #5
    Senior Member icedroplet1987 is on a distinguished road
    Join Date
    Sep 2009
    Posts
    129
    Thanks
    4
    Thanked 0 Times in 0 Posts
    Rep Power
    1

    Default

    when i made changes as you said then INSERT INTO hfjgn_private (text,byuid,touid,timesent) VALUES ('txt', '2','322','1264102501'),('txt', '2','','1264102501'),('txt', '2','','1264102501')OPM was sent successfully to sterla , w0lverln3 , raghavan

  6. #6
    Senior Member djlee
    Join Date
    Jun 2008
    Posts
    257
    Thanks
    0
    Thanked 3 Times in 3 Posts
    Rep Power
    0

    Default

    that means the touid isnt being set for the last 2 messages, that value is controlled by $who which in turn gets its value from getuid_nick($pmtou);.

    I imagine either you are entering an invalid username or there is a problem with your getuid_nick function (or that function isnt doing what you think it does)

  7. #7
    Senior Member icedroplet1987 is on a distinguished road
    Join Date
    Sep 2009
    Posts
    129
    Thanks
    4
    Thanked 0 Times in 0 Posts
    Rep Power
    1

    Default

    well 322 is the uid.. function getuid is ok as it selected ids.. but still not in this format 1 , 2 , 3 , 4 etc

  8. #8
    Senior Member djlee
    Join Date
    Jun 2008
    Posts
    257
    Thanks
    0
    Thanked 3 Times in 3 Posts
    Rep Power
    0

    Default

    how do you know getuid function has gotten the id's, 322 is ONE of the id's, the id for sterla to be exact, it is not retrieving the id for the other two, and qute simply it looks like you are putting spaces after or before each comma which obviously means that the 2nd and 3rd user you send it too dont exist with the usernames provided as you have put spaces in there, put the mysql query back to how it was and in my code change

    Code:
     $who = getuid_nick($pmtou);
    
    too
    Code:
     $who = getuid_nick(trim($pmtou));
    

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Similar Threads

  1. Invite Code
    By riderz in forum Site / Script testing and error fixing
    Replies: 5
    Last Post: 01-10-09, 05:14
  2. send invite help
    By riderz in forum Site / Script testing and error fixing
    Replies: 1
    Last Post: 17-09-09, 18:26
  3. Forum Topic
    By extreme in forum Coding Forum
    Replies: 9
    Last Post: 12-12-08, 14:38
  4. Can Any1 Teach Me How 2 Invite Vip N Staff?
    By soul85 in forum REQUEST FORUM
    Replies: 6
    Last Post: 15-07-08, 10:27
  5. Invite Your Friend To Your Site
    By Ghost in forum Scripts Forum
    Replies: 9
    Last Post: 30-03-08, 14:55

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

SEO by vBSEO