![]() |
[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. |
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 |
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 |
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 |
Hi Logician to quote from the original thread:
Quote:
|
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.. ;) |
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... :paranoid: ) - 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---- |
Problem:
How can get the date in the right form ? Can i use php to format from unixtimestamp to readable format? |
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, |
Quote:
|
thx for help i will use the dateformat from Mysql ... and I hope I solve the problem...
|
Another Question: How can I insert any data in the db?
I don't understand , because when I call aformular then ist query done, but I will write the entry and then insert.. Can you help? THX |
Quote:
|
Ok I have done this, but I hope you can realize WRITING to Database... I write a new Template/Query for Sponsorlisting and so on and your Webtemplates make my life easier. THX
WT |
Hi Logician,
I'm a little bit nervous. I have Problems with a newssystem that use your webtemplates... I have no idea, how can be realized with commentfunction... can u help me? The Sponsortemplate is ready, I will share that when I have migration to vb completed... |
I didnt understand what the problem is?!? Can you clarify?
|
The Problem is, that I don't know exactly how can I realize the Newssystem with commentfunction...
my first way was I make a page that call all first thread from a hidden board... and display them on your page, but the smilies don't show's and I have problems with permissions... Everybody should be commenting this thread ... Have you another Idea to realize that... I don't need a template, I need a Idea... PS: The sponsor-thing can you see here http://swishzone.net/vb/show.php?pg=sponsor |
ok so why do you need this in a webtemplate? If you need special permissions for certain forums/users to read/reply etc. you can do that with vbulletin. Do you really need your threads moved in a webtemplate?
If you really need it in a webtemplate then may be you can think of moving only thread subjects to your template not the entire thread. You can link your threads in the template and if someone needs to read/reply, they can click the link and beamed to the original thread in the forum. The hack was not designed to alternate vbulletin's reply feature because we already had it there. Hack's purpose was moreover derive data from the database and automatically create pages integrated with vbulletin. Therefore I dont think we can figure out a way to create a vbulletin reply alternative in a web template.. |
thx for answer...so I will do what you saw, I think i can also the webtemplate design, that I have the post from VB or the headlines only and then a button to send the user to the thread and he can answer there....
Ok... I hopeI can realize that... thx for help... |
Quote:
Hi Logician Great hack :) I have 2 questions. 1: where to add the code above? 2: How do I see where is the user (the whoisonline part) Thanx in advance dm |
Quote:
Say, you created a new Web Template (an HTML page) and you want this page post "I love users who use my Red Style Sheet and you're one of them!" to only users who are using Red Style Sheet. Simply create your webtemplate like an ordinary HTML page, then in the place where you want this text posted insert this code: [[($bbuserinfo['styleid']==X)]] "I love users who use my Red Style Sheet and you're one of them!" [[/($bbuserinfo['styleid']==X)]] While your webtemplate is loaded, the script will check if the viewer's styleid=X and if yes this text will be posted, else it will not.. 2- When your users view a webtemplate, they can be monitored in the "Who is Online". However their location is raw, not in a formatted text. (Anyway you can understand in which webtemplate they are). I would improve this section of the hack with the next release, however I am not sure if I'll code any other releases any more.. Honestly I thought this hack is something that many people can use and benefit, but 1.5 half months passed and only 12 people installed the hack. Seems I was wrong so I think it's not worth spending times to improve it. Regards, Logician |
Quote:
|
Thanx :)
Quote:
|
Quote:
Thx for the nice comments though.. |
Quote:
|
Quote:
Thats just my $0.02 worth. |
Quote:
|
sorry Logician Im a newbie I cant giv ya the feedback u need:(, but I can tell ya that, its runing fine on my testboard and I love it and u r damn good to giv dummie instructions :D lately there is only 2 hcak which impressed the vBindex and this TemplateHack.
I hope I can use it with the v3 when its out otherwise Im not going to upgrade to v3 :D |
Quote:
|
Quote:
In fact I cant see any reason that it will not work with VB3. The script what does the real job is independent from the vbcode. So even if they change the all code, I think it will keep on working provided that "global.php" file structure is same. Anyway I think there will no clash between vb3 and this hack that I cant fix.. |
The thing that made me think that it may not work is the fact that the template system (I'm sure I read somewhere) has change quite abit, but that depends how much this hack relies on the built-in template system of vB.
|
Quote:
The hack's only common point with Vbulletin is, it uses vbulletin's variables and values (such as username, user style set id etc.) and hack compiles this info via global.php, just like other vbulletin scripts like showthread.php, forumdisplay.php etc. So if they dont touch this system, script will work with even vbulletin 3000 ;) If they change the system, then they have to substitute a similiar system to compile userdata for native vbulletin files and then I have to make a modification in my script and apply the same system they have adopted. Therefore I dont think there will be any problems with new releases. |
Hi Logician,
I have found a bug... the queryname is $_listedownloadprogramme and this don't work and rename to $_listedlprog work fine. The Name to long? My other (working queryname) Quote:
Quote:
I realize a Download at the moment with a seperate *.php, because I must give the ID for the target.... and so on... it's very great code and this safe my rarely time... this is definitely my favourite hack ! |
another tip, when the name to long and a query have the first charackter identical then have you a problem
when i have a querystatement in the template $_listedownloadsprogramme and a query $_listedownloads the will query $_listedownloads use and in the template is printing "programme" ... I little bug... :-) (very small) |
Wildthinks I tested "_listedownloadprogramme" as WebQuery name and it worked here. I dont know what problem you encountered but I created a new webquery named "_listedownloadprogramme", then added the $_listedownloadprogramme variable into my webtemplate and it listed the results.
as for second one: ($_listedownloadsprogramme/$_listedownloads) yes you may have a point. I noted it down and will check it in the new release if there will be a new release :) |
I'm busy on job next week, after that I will send you a "problem" for me ....
Quote:
|
Quote:
Then all of a sudden I realize that there are "real fans" of the hack. It's really surprising. Thx anyway.. :) I'll think about improving it. |
yes... give me a little bit more time to understand and test out all features from your hack...what I really really need is transfer variables from site to site...
See my Downloadmanager in test and developening.... http://swishzone.net/vb -> click on download or on sponsor ... this use your webtemplate ...btw the next one is news and a big intro-site ... soon.... grafix in developement... |
so we going to the point...
bugreport Webtemplates 1. ??Count(dlm_files.id)?? don't work 2. I can't one webtemplate insert in a other... but I use the querytemplates for it... i create a simple (needed and also cached) query and so work this... can you make a button to say have query or not and so can I use as a webtemplate.. Logician ... i don't understand... i Can't insert webtemplate, but I can insert querys... I think you can insert a query without query... so have you the possibility to insert webtemplates in other... 3. to much space between ??var1?? and ??var1?? sample: original Downloads: ??var1?? in html Downloads: ??var1?? 4. Wish: include Template in Standardtemplate from VB 5. don't work in footer or header as template with templateoption or standalone... means that I can't use query's or templates in footer or header... 6. casesensitiv? the names are casesensitiv? sometimes yes sometimes no? samples for templates on my site all in downloads.... http://swishzone.net/vb/show.php?pg=downloadsswi20 Sponsorlist: http://swishzone.net/vb/show.php?pg=sponsor Regards... |
Hiyas,
Quote:
No ().?*,"' etc.. Quote:
Yes you cant insert webtemplate inside webtemplate. You can insert many webqueries inside 1 webtemplates though. Quote:
Quote:
And there is no need for that either. If you need to use a vb template, simply copy/paste its contents to your webtemplate. Quote:
Quote:
Regards, |
All times are GMT. The time now is 02:46 AM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|