Previous Thread
Next Thread
Print Thread
Rate Thread
Joined: Jan 2003
Posts: 338
Enthusiast
Enthusiast
Offline
Joined: Jan 2003
Posts: 338
Mod Name - Abbilty to send PM to all users
Version - 0.2
Description - You write PM from admin section and it will send to all users.
Working Under - should work under ubbt 6.2.x (testing under 6.1.1)
Files Altered -
admin/menu.php
New Files - admin/edit_PM.php, admin/do_PM.php
New Database Tables - no
Author - slawekl (Slawomir Lorenc)

[NEW VERSION]
In new version script looks better.
-----------------------------------
edit menu.php

at the and of admin options add:
<br>
<a href="{$config['phpurl']}/admin/edit_PM.php" target="mainFrame">
SEND PM
</a>

-------
Upload 2 new files to admin folder.
Attachments
76893-PM_v02.zip (0 Bytes, 44 downloads)

Last edited by slawekl; 04/23/2003 6:30 AM.
Sponsored Links
Joined: Aug 2002
Posts: 218
Member
Member
Offline
Joined: Aug 2002
Posts: 218
Hi slawekl,

I added this to my board and have a small problem. I wrote a PM to all my users and they get the small letter that a new mail is waiting for them in their private mail folder but no mail is in.

I am using 6.2.3 and I think there is something not really working with your script.

Info: I updated month ago from ubb.classic and my admin has another userid than 2. Could this be a problem?

Short: Users are getting info about new mail but none is in their home

Joined: Jan 2003
Posts: 338
Enthusiast
Enthusiast
Offline
Joined: Jan 2003
Posts: 338
Check if in 6.2.3 exist "ALL_GROUP" value. You must check it in ubb.inc.php file. My script doesn't contain get_input function, which is required for all 6.2.x scrpits.
I tested my script in 6.0.2 and 6.1.1 and 6.2

Joined: Aug 2002
Posts: 218
Member
Member
Offline
Joined: Aug 2002
Posts: 218
The only thing I found in ubbt.inc.php 6.2.3 was
Code
<br />elseif ($Group == "ALL_USERS") {<br />         $selector = "";<br />


There is nothing with ALL_GROUP.

Can you please modify this hack to work on 6.2.3 and 6.3 cause its quite cool

edr #243624 04/24/2003 6:32 PM
Joined: Jan 2003
Posts: 338
Enthusiast
Enthusiast
Offline
Joined: Jan 2003
Posts: 338
File do_PM.php
---------------------
<?
require ("../main.inc.php");
$Cat = get_input("Cat","get");
$User = get_input("User","get");
$userob = new user;
$user = $userob -> authenticate();
$html = new html;
$query = "
SELECT U_Groups
FROM {$config['tbprefix']}Users
WHERE U_Username = '$Username_q'
";
$sth = $dbh -> do_query($query);
list($groups) = $dbh -> fetch_array($sth);
$dbh -> finish_sth($sth);
$Sender = $user['U_Username'];
$Subject = "$Subject";
$mess = "$Body";
$html -> send_message($Sender,"",$Subject,$mess,"ALL_USERS");
$Sender = $user['U_Username'];
$To = $User;
$Subject = "$Subject";
$mess = "$Body";
$html -> send_message($Sender,$To,$Subject,$mess);
$html -> send_header ("PM was sended",$Cat,$user);
$html -> admin_table_header("PM was sended");
$html -> send_admin_footer();
?>

Sponsored Links
Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
That won't work in 6.2 or higher, because everything uses numbers.... not You'd have to convert Sender and Recipient to numbers.

Daine #243626 04/24/2003 9:59 PM
Joined: Aug 2002
Posts: 218
Member
Member
Offline
Joined: Aug 2002
Posts: 218
Sorry what must I do to get this working with 6.2.3 Josh?

edr #243627 04/24/2003 10:02 PM
Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
I'm not sure exactly, but places it's referencing...

$Sender = $user['U_Username']

would need to be

$Sender = $user['U_Number']

as Usernames aren't used in any tables but the users table in 6.2 or higher.

Daine #243628 04/25/2003 5:48 AM
Joined: Aug 2002
Posts: 218
Member
Member
Offline
Joined: Aug 2002
Posts: 218
do_PM.php must look like this to make it working with 6.2.x
Code
<br /><br /><?<br />   require ("../main.inc.php");<br />   $userob = new user;<br />   $user = $userob -> authenticate();<br />   $html = new html;<br />   $query = "<br />    SELECT U_Groups<br />    FROM   {$config['tbprefix']}Users<br />    WHERE  U_Username = '$Username_q'<br />   ";<br />   $sth = $dbh -> do_query($query);<br />   list($groups) = $dbh -> fetch_array($sth);<br />   $dbh -> finish_sth($sth);<br />   $Sender = $user['U_Number'];<br />   $Subject = "$Subject";<br />   $mess    = "$Body";<br />   $html -> send_message($Sender,"",$Subject,$mess,"ALL_USERS");<br />   $Sender = $user['U_Number'];<br />   $To      = $User;<br />   $Subject = "$Subject";<br />   $mess    = "$Body";<br />   $html -> send_message($Sender,$To,$Subject,$mess);    <br />   $html -> send_header ("PM has been send",$Cat,$user);<br />   $html -> admin_table_header("PM has been send");<br />   $html -> send_admin_footer();<br />?><br />


I've tested it and its working fine. Thanks for your help Josh.

Daine #243629 04/25/2003 6:21 AM
Joined: Jan 2003
Posts: 338
Enthusiast
Enthusiast
Offline
Joined: Jan 2003
Posts: 338
ups... Mea culpa.. I've fogotted about that (:

Sponsored Links
Dawg_dup1 #243630 04/26/2003 10:54 PM
Joined: Jan 2003
Posts: 24
Junior Member
Junior Member
Offline
Joined: Jan 2003
Posts: 24
Cool hack!

Have one sort of annoying problem though, I downloaded the 1st set of code, which as other members have stated - sends out a blank PM.

Problem is, even though my Inbox appears empty, its stating theres still 1 message available. I know it isn't really a major problem, but it's gonna stir up some of my members

Does anyone know how I can purge these 'ghost PM's' from the system?

Oh! and After I installed the fix, everything else is working just great!

Edit - Never mind FIXED!.. In a fit of panic, I forgot allllll about that little thing known as the SQL Database

Last edited by Doogz; 04/26/2003 10:58 PM.
Joined: Apr 2001
Posts: 186
Member
Member
Offline
Joined: Apr 2001
Posts: 186
is it possible to make an dropdown box to select vhich group to send the pm to ??

Thomas


Link Copied to Clipboard
Donate Today!
Donate via PayPal

Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.

Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
Bill B
Bill B
Issaquah, WA
Posts: 87
Joined: December 2001
Forum Statistics
Forums63
Topics37,573
Posts293,925
Members13,849
Most Online5,166
Sep 15th, 2019
Today's Statistics
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,833
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
WebGuy 2
Morgan 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2024 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20240430)