Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
FAQ Community Calendar Today's Posts Search

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #33  
Old 04-12-2006, 05:38 PM
bada_bing's Avatar
bada_bing bada_bing is offline
 
Join Date: Feb 2004
Location: Michigan
Posts: 1,698
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Logician
This WebQuery will display the last XX private messages of your members. So if you want to keep your member's pms under surveillance, you'll like this one

Here we go: Login your CP and click ADD QUERY:
Fill the form accordingly:

QUERY NAME:
----------------
_privatemessages

QUERY:
---------
SELECT privatemessageid, fromuserid, touserid, title, message, touser.username AS tousername, fromuser.username AS fromusername
FROM privatemessage
LEFT JOIN user AS touser ON (touser.userid=privatemessage.touserid)
LEFT JOIN user AS fromuser ON (fromuser.userid=privatemessage.fromuserid)
WHERE folderid='0'
ORDER BY privatemessageid DESC LIMIT 30

(Change 30 to whatever you want for last XX messages)

DESCRIPTION:
-------------------
Read last XX private messages of your forum.

NO RESULT TEXT:
----------------------
No private messages exist in the database!

TABLE ROW:
---------------------
<table width="100%" border="0" cellspacing="1" cellpadding="1" bgcolor="#0000FF"><tr><td><table width="100%" border="0" cellspacing="0" cellpadding="0" bgcolor="#FFFFFF"><tr> <td ><div align="center"><normalfont>Message
ID: ??privatemessageid??</normalfont></div>
</td><td ><div align="center"><normalfont><a href="$bburl/member.php?s=&action=getinfo&userid=??fromuserid?? ">??fromusername??</a></normalfont></div>
</td><td ><div align="center"><normalfont><a href="$bburl/member.php?s=&action=getinfo&userid=??touserid??"> ??tousername??</a></normalfont></div></td></tr><tr>
<td colspan="3" ><normalfont>??title??</normalfont></td></tr><tr>
<td colspan="3" ><normalfont>??message??</normalfont></td></tr></table></td></tr></table>


Save your query and it's ready to rock. Now let's add a Webtemplate to attach your query:

Click ADD WEBTEMPLATE and create your HTML page as you like. Just a few points about your webtemplate:
1- Insert $_privatemessages in your template in the place where you want the private messages displayed.
2- Insert [options]templatequeryon[/options] anywhere in your template so that the script will parse your WebQuery.
3- Dont forget to ban this page to your ordinary users so that other members wont see all pms of all users. Give access to specific users/usergroups for this page. Eg. insert :

[cantsee]everybody[/cantsee][cansee]6 Admin[/cansee]

This will ban the template to all users except whose usergroup id is 6 or username is "Admin"

Just a WebTemplate Sample here:
(Remember WebTemplates are simple HTML pages so you can create them by yourself, this is just an example)
-- cut ----
[cantsee]everybody[/cantsee][cansee]6 Admin[/cansee] [options]templatequeryon[/options]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head>
<!-- no cache headers -->
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="no-cache">
<meta http-equiv="Expires" content="-1">
<meta http-equiv="Cache-Control" content="no-cache">
<!-- end no cache headers -->
<title>$bbtitle </title>
<p align="left">$headinclude </head> <body> $header <br><p>

<p align="left"> <normal></normal></p>
<table width="100%" border="0" cellspacing="5" cellpadding="0">
<tr>
<td valign="top">
<p align="center"><smallfont>The page you accessed is visited by '$count' times.
Last visitor of this page was "$lastvisitorname" who visited the page at $lastvisittime.</smallfont></p>
<p>&nbsp;</p>
<div align="left">
<table cellpadding="4" cellspacing="1" border="0" width="100%">
<tr id="cat">
<td bgcolor="#606096"><normalfont color="#FFF788"><b>Last
30 Private Messages From Your Board:</b></normalfont></td>
</tr>
<tr>
<td bgcolor="#F1F1F1">
<p><normalfont> </normalfont><normalfont>$_privatemessages<br>
</normalfont></p>
</td>
</tr>
</table>
<p align="center"><smallfont></smallfont></p>
</div>
</td>
</tr>
</table>
$footer
-- cut --------

That's all! Now you can call your webtemplate as http://your_board_url/show.php?pg=your_template_name to monitor last XX pms in your board.

Enjoy!
Logician
I am trying to run a query but admincp is giving me this message

You are not authorized to execute SQL queries

I am logged in as Administrator???
Reply With Quote
 


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 11:16 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.09508 seconds
  • Memory Usage 3,674KB
  • Queries Executed 13 (?)
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
  • (6)bbcode_code
  • (2)bbcode_php
  • (20)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (40)post_thanks_box
  • (40)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (40)post_thanks_postbit_info
  • (40)postbit
  • (1)postbit_attachment
  • (40)postbit_onlinestatus
  • (40)postbit_wrapper
  • (1)showthread_list
  • (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_threadedmode.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • 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_threaded
  • showthread_threaded_construct_link
  • 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_attachment
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete