VideoHelp Forum
+ Reply to Thread
Results 1 to 8 of 8
Thread
  1. Member
    Join Date
    Feb 2001
    Location
    51`N 5'W #linux & #vcdhelp @ DALnet
    Search Comp PM
    Hey Baldrick, could you code a function that will allow us to delete several private messages at once? Like you can with most Email accounts. Say for instance a check box by each message that will allow you to delete in one go instead of one at a time.
    It takes me forever to delete my messages, its all TIbrO's fault, that crazy nerd loves to send me private messages :
    Im sure that he would like the feature as I send him just a many, LOL. Im sure speedy would like to mass delete all my messages to him as well... I dont think he likes me much, hehe.
    Quote Quote  
  2. I'm a MEGA Super Moderator Baldrick's Avatar
    Join Date
    Aug 2000
    Location
    Sweden
    Search Comp PM
    okey....will do it as soon as possible(a year or two....)
    Quote Quote  
  3. Member
    Join Date
    Feb 2001
    Location
    51`N 5'W #linux & #vcdhelp @ DALnet
    Search Comp PM
    damn it! faster... before that crazy TIbrO "private message bombs" me again! He fills up my private message list faster than you can say "You have 99 new private messages".
    If you want I will learn PHP and code the damn function for you - probably be faster that way, LOL.

    I hope you mean fly years... ant years or something... for the love of God man! Its PHP - The language was designed for lazyness! Probably only take 3 lines of lame-ass-high-level-slow-running code anyway!
    Quote Quote  
  4. I'm a MEGA Super Moderator Baldrick's Avatar
    Join Date
    Aug 2000
    Location
    Sweden
    Search Comp PM
    okey...here is the code...just add a sql delete statement and remove link.

    <?php
    /************************************************** *************************
    viewpmsg.php - description
    -------------------
    begin : Wed June 19 2000
    copyright : (C) 2000 by James Atkinson
    email : james@totalgeek.org

    $Id: viewpmsg.php,v 1.18 2001/02/07 21:58:48 bartvb Exp $

    ************************************************** *************************/

    /************************************************** *************************
    *
    * This program is free software; you can redistribute it and/or modify
    * it under the terms of the GNU General Public License as published by
    * the Free Software Foundation; either version 2 of the License, or
    * (at your option) any later version.
    *
    ************************************************** *************************/

    /**
    * viewpmsg.$phpEx - Nathan Codding
    * - Used for receiving private messages between users of the BB.
    */
    include('extention.inc');
    include('functions.'.$phpEx);
    include('config.'.$phpEx);
    require('auth.'.$phpEx);
    $pagetitle = "Private Messages";
    $pagetype = "privmsgs";


    if (!$submit && !$user_logged_in) {
    include('page_header.'.$phpEx);
    login_form();
    } else {

    if (!$user_logged_in) {
    if ($user == '' || $passwd == '') {
    error_die("$l_userpass $l_tryagain&quot;
    }
    if (!check_username($user, $db)) {
    error_die("$l_nouser $l_tryagain&quot;
    }
    if (!check_user_pw($user, $passwd, $db)) {
    error_die("$l_wrongpass $l_tryagain&quot;
    }

    /* throw away user data from the cookie, use username from the form to get new data */
    $userdata = get_userdata($user, $db);
    if(is_banned($userdata[user_id], "username", $db))
    error_die($l_banned);

    // Log them in, they are authenticated!
    $sessid = new_session($userdata[user_id], $REMOTE_ADDR, $sesscookietime, $db);
    set_session_cookie($sessid, $sesscookietime, $sesscookiename, $cookiepath, $cookiedomain, $cookiesecure);

    }
    include('page_header.'.$phpEx);
    $sql = "SELECT * FROM priv_msgs WHERE (to_userid = $userdata[user_id]) ORDER BY msg_time";
    $resultID = mysql_query($sql, $db);
    if (!$resultID) {
    error_die("Error getting messages from DB.&quot;
    }

    ?>

    <TABLE BORDER="0" CELLPADDING="1" CELLPADDING="0" ALIGN="CENTER" VALIGN="TOP" WIDTH="95%"><TR><TD BGCOLOR="<?php echo $table_bgcolor?>">
    <TABLE BORDER="0" CELLPADDING="3" CELLPADDING="1" WIDTH="100%">
    <TR BGCOLOR="<?php echo $color1?>" ALIGN="LEFT">
    <TD WIDTH=20% COLSPAN=2><?php echo $l_from?></TD>
    </TR>

    <?php
    if (!mysql_num_rows($resultID)) {
    echo "<TD BGCOLOR=\"$color1\" colspan = 2 ALIGN=CENTER>$l_nopmsgs</TD></TR>\n";
    }

    while ($myrow = mysql_fetch_array($resultID)) {

    echo "<TR BGCOLOR=\"#F1EDED\" ALIGN=\"LEFT\">\n";
    $posterdata = get_userdata_from_id($myrow[from_userid], $db);
    echo "<TD width=15% nowrap valign=top><font face=Verdana Size=2>$posterdata[username]
    \n";
    $posts = $posterdata[user_posts];
    echo "<a href=\"bb_profile.$phpEx?mode=view&user=$posterdat a[user_id]\"><img src=\"$profile_image\" border=0 alt=\"$l_profileof $myrow[poster_name]\"></a>\n";
    if($posterdata["user_viewemail"] != 0)
    echo "<a href=\"mailtoposterdata[user_email]\"><IMG SRC=\"$email_image\" BORDER=0 ALT=\"$l_emial $posterdata[username]\"></a>\n";
    //if($posterdata["user_web"] != '') {
    // if(strstr("http://", $posterdata["user_web"]))
    // $posterdata["user_web"] = "http://" . $posterdata["user_web"];
    // echo "<a href=\"$posterdata[user_web]\" TARGET=\"_blank\"><IMG SRC=\"$www_image\" BORDER=0 ALT=\"$l_viewsite $posterdata[username]\"></a>\n";
    // }
    // if($posterdata["user_icq"] != '')
    // echo "<a href=\"http://wwp.mirabilis.com/$posterdata[user_icq]\" TARGET=\"_blank\"><IMG SRC=\"http://wwp.icq.com/scripts/online.dll?icq=$posterdata[user_icq]&img=5\" BORDER=0\"></a>";

    /*if($posts < 15)
    echo "<font size=-2>$rank1
    \n";
    else
    echo "<font size=-2>$rank2
    \n";
    echo "
    <font size=-2>$l_posts: $posts
    \n";
    echo "$l_location: $posterdata[user_from]
    </FONT></TD>\n";*/
    echo "</FONT></TD>\n<TD width=85%><img src=\"$posticon\"><font size=-1>$l_posted: $myrow[msg_time]&nbsp";
    echo "<HR size=1 color=white></font><font face=Verdana Size=2>\n";
    $message = stripslashes($myrow[msg_text]);
    echo $message . "

    ";
    echo "<HR size=1 color=black>\n";

    //if($posterdata["user_aim"] != '')
    // echo "<a href=\"aim:goim?screenname=$posterdata[user_aim]&message=Hi+$posterdata[user_aim].+Are+you+there?\"><img src=\"$aim_image\" border=\"0\"></a>";

    echo "<a href=\"replypmsg.$phpEx?msgid=$myrow[msg_id]&quote=1\">$l_replyquote</a>\n";
    echo "<a href=\"replypmsg.$phpEx?msgid=$myrow[msg_id]\">$l_reply</a>\n";
    echo "<a href=\"$url_phpbb/delpmsg.$phpEx?msgid=$myrow[msg_id]\">$l_delete</a>\n";

    echo "</TD></TR>";
    } //while ($myrow = mysql_fetch_array($resultID));

    $sql = "UPDATE priv_msgs SET msg_status='1' WHERE (to_userid = $userdata[user_id])";
    if (!mysql_query($sql, $db)) {
    error_die("Error marking the messages as read in the DB.&quot;
    }

    ?>

    </TABLE></TD></TR></TABLE>
    <TABLE ALIGN="CENTER" BORDER="0" WIDTH="95%">

    <TR>
    <TD>

    </TD>
    <TD ALIGN="RIGHT">
    <?php make_jumpbox()?>
    </TD>
    </TR></TABLE>

    <?php

    } // if/else

    require('page_tail.'.$phpEx);
    ?>
    Quote Quote  
  5. I'm a MEGA Super Moderator Baldrick's Avatar
    Join Date
    Aug 2000
    Location
    Sweden
    Search Comp PM
    here do you add the delete sql statement...

    <?php
    /************************************************** *************************
    delpmsg.php - description
    -------------------
    begin : Wed June 19 2000
    copyright : (C) 2000 by James Atkinson
    email : james@totalgeek.org

    $Id: delpmsg.php,v 1.8 2001/02/07 20:44:21 bartvb Exp $

    ************************************************** *************************/

    /************************************************** *************************
    *
    * This program is free software; you can redistribute it and/or modify
    * it under the terms of the GNU General Public License as published by
    * the Free Software Foundation; either version 2 of the License, or
    * (at your option) any later version.
    *
    ************************************************** *************************/

    /**
    * delpmsg.php - Nathan Codding
    * - Used for deleting private messages by users of the BB.
    */
    include('extention.inc');
    include('functions.'.$phpEx);
    include('config.'.$phpEx);
    require('auth.'.$phpEx);
    $pagetitle = "Private Messages";
    $pagetype = "privmsgs";
    include('page_header.'.$phpEx);


    if (!$submit && !$user_logged_in) {
    login_form();
    } else {
    if (!$user_logged_in) {
    if ($user == '' || $passwd == '') {
    error_die($l_userpass);
    }
    if (!check_username($user, $db)) {
    error_die("$l_nouser $l_tryagain&quot;
    }
    if (!check_user_pw($user, $passwd, $db)) {
    error_die("$l_wrongpass&quot;
    }

    /* throw away user data from the cookie, use username from the form to get new data */
    $userdata = get_userdata($user, $db);
    }

    $sql = "SELECT to_userid FROM priv_msgs WHERE (msg_id = $msgid)";
    $resultID = mysql_query($sql);
    if (!$resultID) {
    echo mysql_error() . "
    \n";
    error_die("Error during DB query (checking msg ownership)&quot;
    }
    $row = mysql_fetch_array($resultID);
    if ($userdata[user_id] != $row[to_userid]) {
    error_die("That's not your message. You can't delete it.&quot;
    }

    $deleteSQL = "DELETE FROM priv_msgs WHERE (msg_id = $msgid)";
    $success = mysql_query($deleteSQL);
    if (!$success) {
    error_die("Error deleting from DB.&quot;
    }
    echo "
    <TABLE BORDER=\"0\" CELLPADDING=\"1\" CELLSPACING=\"0\" ALIGN=\"CENTER\" VALIGN=\"TOP\" WIDTH=\"$tablewidth\">";
    echo "<TR><TD BGCOLOR=\"$table_bgcolor\"><TABLE BORDER=\"0\" CALLPADDING=\"1\" CELLSPACING=\"1\" WIDTH=\"100%\">";
    echo "<TR BGCOLOR=\"$color1\" ALIGN=\"LEFT\"><TD><font face=\"Verdana\" size=\"$FontSize2\">

    ";
    echo "


    <center>$l_deletesucces $l_click <a href=\"$url_phpbb/viewpmsg.$phpEx\">$l_here</a> $l_toreturn

    </center></font>";
    echo "</TD></TR></TABLE></TD></TR></TABLE>
    ";

    } // if/else (if submit)

    require('page_tail.'.$phpEx);
    ?>
    Quote Quote  
  6. Member
    Join Date
    Feb 2001
    Location
    51`N 5'W #linux & #vcdhelp @ DALnet
    Search Comp PM
    cool... can you post the code all the other functions this site uses? Especially the user authenticating functions and the user database.
    Quote Quote  
  7. I'm a MEGA Super Moderator Baldrick's Avatar
    Join Date
    Aug 2000
    Location
    Sweden
    Search Comp PM
    Quote Quote  
  8. Member
    Join Date
    Feb 2001
    Location
    51`N 5'W #linux & #vcdhelp @ DALnet
    Search Comp PM
    ... and your user database? LOL!
    Im not coding your functions dude... I'm an "313373" C programmer, wouldnt want to dirty my hands with PHP now would I? ROTFLMAO.
    here:

    #include <stdio.h>
    #include <string.h>
    void main()
    {
    char coder[]="baldrick";
    char name[10];
    char name1[]="Lamer";
    char name2[]="313373";
    puts("What is your name?");
    gets(name);
    fprintf(stdout,"%s is a %s\n",coder,name1);
    fprintf(stdout,"d4n13l is '%s'\n",name2);
    fprintf(stdout,"LOL\n\n");
    if(!strcmp(coder,name))
    {
    fprintf(stdout,"Get coding lazy bones...\n\n\n");
    fprintf(stderr,"...like now dude!");
    }
    else
    {
    fprintf(stdout,"you are 1337 - do not dirty your\n");
    fprintf(stdout,"hands with a\n");
    fprintf(stdout,"high-level lamer language ");
    }
    fprintf(stdout,"\n\n");
    }

    /* coded by d4n13l... not cut 'n' pasted from "hotscripts" hehe */

    put that in your compiler and smoke it!
    LOL



    <font size=-1>[ This Message was edited by: d4n13l on 2001-10-22 16:09:11 ]</font>
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!