The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
[WEBTEMPLATES HACK:]Share your WebTemplates or WebQueries!
Dear Friends,
This thread is for sharing your WebTemplates and WebQueries with other WebTemplates Hack users. If you have questions about the hack itself or need support about installation of the hack, please forward your questions in the original thread. If you installed the hack you can insert other user's WebQueries(or Web Templates) from your Admin Control panel/Add WebQuery(WebTemplate) link. It's just like adding a vbcode. After adding your templates and queries just call the webtemplate you created from your browser and you have the page! Let's devote this thread to requesting/sharing Webtemplates and especially WebQueries. Share away! Logician Ps. If you haven't installed WebTemplates Hack, this thread will be no help to you. Go check the original thread. |
#2
|
||||
|
||||
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> </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 |
#3
|
||||
|
||||
Okay Logician,
Since you saw the other thread that I posted in the other spot I hope I this is the correct spot to ask some questions. Not some much for the install, which was easy and went well, but for some more examples. I have it installed and have been playing around with it, however my knowledge on this kind of programming is limited. I figured out how to do custom pages and such and that was easy but the one big hurdle I have been running in to is having the header switch for differant styles that I use. Let's say for example I have multiple stlyes that I use. In each of these styles the header is totally differant. Is there a way that I make a page in web templates and have it changed according to the style the user has selected. Looking at it I don't think it's possible since it basically created a whole new section of templates which it draws from. Any tips would be appreciated. Mike |
#4
|
||||
|
||||
Yes this is possible:
What you have to do is create a "conditional" depending on user style variable, ie. $bbuserinfo['styleid'] So this should work: -- cut ---- [[($bbuserinfo['styleid']==X)]] your header for users whose styleid is X (Dont forget to replace X with style's id number) [[/($bbuserinfo['styleid']==X)]] [[($bbuserinfo['styleid']==Y)]] your header for users whose styleid is Y (Dont forget to replace Y with style's id number) [[/($bbuserinfo['styleid']==Y)]] -- cut ---- and etc.. Let alone header, you can even design the WHOLE page in a different manner depending on user's style id, if that is what you want. I am not at home now, so couldnt check if it works, but I cant see any reason that it wont. Let me know if this is what you asked.. Regards, Logician |
#5
|
||||
|
||||
Hi Logician to quote from the original thread:
Quote:
|
#6
|
||||
|
||||
Quote:
Quote:
If you want to have an idea how it looks, just apply the webquery about "reading members pms" in this thread, and check the page out: Its quite readable but not parsed so not very presentable.. |
#7
|
||||
|
||||
Hi Logician,
THX is a very cool hack. You are a great developer. Now let's go to the point... :bandit: How can I realize a Newspage with comments Newspage is not a Problem: 1. Create Board 2. set permission all non (not show in normal board) 3. query to get the content... 4. ?? How can I implemt the commentfunction? -Should I create a new commentthread for every Newsentry? (not really... aranoid: ) - oohh my god.... I have a idea ... I will query only the first Post of every thread and user can answer normally ?!? Q: When the board say not allowed to view, but allowed reply...I think that should work? When the rights in your page say allowed and the forum say not allowed is allowed? THX for your help---- |
#8
|
||||
|
||||
Problem:
How can get the date in the right form ? Can i use php to format from unixtimestamp to readable format? |
#9
|
||||
|
||||
Quote:
If you granted a special permission for your webtemplate, this would be different than your board's permissions. Say, you created a webtemplate which can be visible only to mods. Other users wont be able to see this webtemplate (thus the threads there), but if you didnt put special permissions (or make them hidden) in your original board, these threads can still be seen or replied from ordinary (non-mods) members in the board. So the best practise can be appliying your webtemplates permissions to your forum too.. Regards, |
#10
|
||||
|
||||
Quote:
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|