Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 2.x > vBulletin 2.x Full Releases

Reply
 
Thread Tools
Details »»

Version: , by s.molinari s.molinari is offline
Developer Last Online: Sep 2018 Show Printable Version Email this Page

Version: 2.2.x Rating:
Released: 08-20-2001 Last Update: Never Installs: 39
 
No support by the author.

Hello all,

Well I did it, my first real hack. I don't know what the rule on this is but I'll be honest and say I used alot of original vB code to make this. I don't believe in reinventing the wheel and the code in vB is so good it makes it very easy to modify.

This hack will give Admins and Mods the ability to alert users with a small message. This message works similiar to the PM popup. It also has the ability to send one user a number of messages. Each message will be denoted by the person who sent the message.

If you are not competent with Mysql and the inner workings of vB and your not sure if you need this utility I would recommend not installing it.

I consider this to be a Beta since I only tested it on my local dev computer. I would really appreciate some "experienced" users testing this hack to let me know where I've made mistakes.

If someone is real hack happy he/she they could change the hack and add the thing listed on my todo list below. If not I'll get to adding them sooner or later.

Anyhow, have fun. I'll be answering your questions here in this forum.

Scott

Demo Screenshots


To do list:
1. Add option to send a message to online users only(good for telling them that the board will be closing before it's closed)
2. Timestamping the messages. Probably not a bad idea.
3. Checking that messaging is on before messages get stored in
db. Would save Mods the embarassment.
4. Add wild card function '*' to search for user names.

If you have more ideas as to how I could improve this hack feel free to post your ideas here!.

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #42  
Old 08-24-2001, 03:04 PM
s.molinari's Avatar
s.molinari s.molinari is offline
 
Join Date: Nov 2001
Posts: 145
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

If the utility acts like it is working but there are no popups coming it could be one of the following reasons:

1. The $headnewmsg variable is not added to the headinclude template. (I even made this mistake in my demo board.)

2. The board options are not saved in the Admin CP.

3. You added the changes to the /admin/global.php and not to the main global.php or you put the changes in the wrong place.

4. You have Javascript turned off in your browser.

I can't think of any more right now.

This is of course assuming that none of your other hacks change the normal functioning of the $headinclude call in global.php.

Hope this helps.


Scott
Reply With Quote
  #43  
Old 08-24-2001, 03:39 PM
cyrus's Avatar
cyrus cyrus is offline
 
Join Date: Oct 2001
Posts: 159
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

238th line ????

is this compatible with version 2.0.3 toooo ?????/

thanks
Reply With Quote
  #44  
Old 08-24-2001, 04:03 PM
Operations Operations is offline
 
Join Date: Nov 2001
Posts: 13
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

it is for 2.03 compatible

i have this version and it works..
Reply With Quote
  #45  
Old 08-24-2001, 04:05 PM
cyrus's Avatar
cyrus cyrus is offline
 
Join Date: Oct 2001
Posts: 159
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

worked like a spanner and nut

THANKS !!
Reply With Quote
  #46  
Old 08-24-2001, 05:29 PM
Lordmusic
Guest
 
Posts: n/a
Default

Here's my PhPMyAdmin report: 19 Allow Popup messaging? checkmessages 1 This function allows Admins and Mods to send quick private messages to users. yesno 15

and:
</style>

$headnewmsg
$headnewpm
Is in all the templates.

I resaved the control panel options as well.

The problem lies in this bit of the install script:

echo "<p>Adding extra template for popups...</p>\n";
$template = '<script language="JavaScript"> alert_box=alert("$bbtitle Messaging\n\n$popmessage\n");
</script>';

No custom template is created. Please tell me what to do here and I am sure it will work perfectly. I will also write a new document for other users. Thank you.
Reply With Quote
  #47  
Old 08-24-2001, 05:37 PM
Operations Operations is offline
 
Join Date: Nov 2001
Posts: 13
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

look in your phpmy admin
enter
"SELECT * from template where title like "head_newmsg" LIMIT 0, 30 " if there is the template that all is ok..
if there is none enter new template

Code:
templateid  templatesetid  title                       template  
Your id   -             1                head_newmsg   <script language="JavaScript"> alert_box=alert("$bbtitle Messaging\n\n$popmessage\n"); </script>
You have to Create a template called "head_newmsg"

Insert in the template
Code:
<script language="JavaScript"> alert_box=alert("$bbtitle  Messaging\n\n$popmessage\n");
</script>
ok?
Reply With Quote
  #48  
Old 08-24-2001, 06:12 PM
s.molinari's Avatar
s.molinari s.molinari is offline
 
Join Date: Nov 2001
Posts: 145
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

hmmm..

Lordmusic do you have more than one template set?

Scott
Reply With Quote
  #49  
Old 08-24-2001, 07:58 PM
Lordmusic
Guest
 
Posts: n/a
Default

Yep I have 4 and I have applied this to all of them. I am still working on it. I customy added all the MySQL stuff, added the $ command to all sections, and the template. Still no luck. I have tried everything. I get no errors, but I get no popups eigther.

Everything should be working perfectly, any ideas?
Reply With Quote
  #50  
Old 08-25-2001, 06:47 AM
s.molinari's Avatar
s.molinari s.molinari is offline
 
Join Date: Nov 2001
Posts: 145
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hello Lordmusic,

Could you check the phpmysql results when you run these queries.

SELECT * FROM template WHERE title='head_newmsg'

Here your looking for 4 or 5 results. When you say 4 style sets does that include the default? Normally though the default (-1) is loaded automatically so if you have one result with templatesetid -1 then that should be ok.

SELECT * FROM template WHERE title='options'

Here you are looking for the last variable. You should see something like:...."; $WOLresolve = "1"; $WOLrefresh = "60"; $checkmessages = "1";

SELECT * FROM template WHERE title='headinclude'

Again, if you have 4 sets of templates then you should have 4 or 5 results. Make sure what's below is at the end of all templates.

#EEEEFF; } </style> $headnewmsg $headnewpm


If everything checks out ok then we'll have to take a look at where you added the code in the global.php script.

Scott
Reply With Quote
  #51  
Old 08-26-2001, 06:19 AM
Lordmusic
Guest
 
Posts: n/a
Default

| 6222 | -1 | head_newmsg | ".addslashes($template)."
|
| 6223 | 1 | head_newmsg | <script language="JavaScript"> aler
t_box=alert("$bbtitle Messaging\n\n$popmessage\n");
</script> |
| 6224 | 6 | head_newmsg | <script language="JavaScript"> aler
t_box=alert("$bbtitle Messaging\n\n$popmessage\n");
</script> |
| 6226 | 7 | head_newmsg | <script language="JavaScript"> aler
t_box=alert("$bbtitle Messaging\n\n$popmessage\n");
</script> |
| 6227 | 8 | head_newmsg | <script language="JavaScript"> aler
t_box=alert("$bbtitle Messaging\n\n$popmessage\n");
</script> |
| 6225 | 9 | head_newmsg | <script language="JavaScript"> aler
t_box=alert("$bbtitle Messaging\n\n$popmessage\n");
</script> |
+------------+---------------+-------------+------------------------------------
----------------------------------------------------------------+
6 rows in set (0.01 sec)
_________________________________________

$WOLenable = "1";
$WOLguests = "1";
$WOLresolve = "1";
$WOLrefresh = "60";
$allowimgsizefailure = "0";
$allowvbcodebuttons = "1";
$memberAllGood = "1";
$checkmessages = "1";
_________________________________________

a.pageNum:hover {color: #ffffff; background-color: #a0a0a0;}
</style>

$headnewmsg
$headnewpm |
________________________________________
In Global.php base directory, not admin...

$newpmmsg=0;
$headnewpm='';
if ($checknewpm and $bbuserinfo['userid']!=0 and $bbuserinfo['pmpopup']==2) {
if ($noshutdownfunc) {
$DB_site->query("UPDATE user SET pmpopup=1 WHERE userid=$bbuserinfo[userid]");
} else {
$shutdownqueries[]="UPDATE LOW_PRIORITY user SET pmpopup=1 WHERE userid=$bbuserinfo[userid]";
}
$newpmmsg=1;
eval("\$headnewpm = \"".gettemplate('head_newpm')."\";");
}
if ($checkmessages and $bbuserinfo['userid']!=0 and $bbuserinfo['messagepopup']==2) {
$popupmessages = $DB_site->query("SELECT * FROM popupmsgs WHERE userid=$bbuserinfo[userid] ORDER BY nummessages DESC");
while ($popmsg = $DB_site->fetch_array($popupmessages)) {
$popmessage .= "Von:$popmsg[sender]\n";
$popmessage .= "Nachricht:$popmsg[message]\n\n";
$DB_site->query("DELETE FROM popupmsgs WHERE nummessages=$popmsg[nummessages] AND userid=$bbuserinfo[userid]");
}
$DB_site->query("UPDATE user SET messagepopup=1 WHERE userid=$bbuserinfo[userid]");
eval("\$headnewmsg = \"".gettemplate('head_newmsg')."\";");
}
$header='';
$footer='';
___________________________________

Weird isn't it...
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 06:10 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04965 seconds
  • Memory Usage 2,303KB
  • Queries Executed 25 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (2)bbcode_code
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (8)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete