Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
  #1  
Old 03-26-2002, 03:00 PM
Logician's Avatar
Logician Logician is offline
 
Join Date: Nov 2001
Location: inside vb code
Posts: 4,449
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default [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.
Reply With Quote
  #2  
Old 03-26-2002, 03:19 PM
Logician's Avatar
Logician Logician is offline
 
Join Date: Nov 2001
Location: inside vb code
Posts: 4,449
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #3  
Old 04-03-2002, 08:32 AM
indiamike's Avatar
indiamike indiamike is offline
 
Join Date: Oct 2001
Location: New Jersey, India
Posts: 124
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #4  
Old 04-04-2002, 06:33 AM
Logician's Avatar
Logician Logician is offline
 
Join Date: Nov 2001
Location: inside vb code
Posts: 4,449
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #5  
Old 04-12-2002, 07:54 PM
WizyWyg's Avatar
WizyWyg WizyWyg is offline
 
Join Date: Oct 2001
Posts: 63
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hi Logician to quote from the original thread:

Quote:
Figured out how to do the post all threads (take off limit 10)
But how do I make the query only look at the private forum that he/she only has acces to? And apply to to every usergroup? I have all my users in usergroups (so no one under registered or groupid 2

I think i have the idea to make similar "whoareyou" templates for each usergroup I have so they would only have access to it. Would that be wise to do?

Another q:

Is it possible that instead of taking the user to the actual forum itself to view the thread, but to pull the contents of the thread and have them be viewed in a "threaded" format?

Is this possible?
I want to clear up that I dont want the query to look at a specific page in a thread, just to pull threads from only the private forum that the user belongs to. I dont want any of the public forum threads they may have posted to be displayed.
Reply With Quote
  #6  
Old 04-12-2002, 08:11 PM
Logician's Avatar
Logician Logician is offline
 
Join Date: Nov 2001
Location: inside vb code
Posts: 4,449
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by WizyWyg
I think i have the idea to make similar "whoareyou" templates for each usergroup I have so they would only have access to it. Would that be wise to do?
Yes it would be wise to solve the problem in this manner: Create a sample "WebTemplate" (like whoareyou), then copy the same template with different names and in the begining of each one strict it to a certain usergroup. So every usergroup will have access to only his webtemplate.

Quote:
Originally posted by WizyWyg

Is it possible that instead of taking the user to the actual forum itself to view the thread, but to pull the contents of the thread and have them be viewed in a "threaded" format?
Does "threaded format" means the format a user reads a thread? If so, yes this is possible too. Simply pull the post itself with your webquery and the script will automatically list it in the way you like. But I dont know if you'll like this listing, because post will not be parsed (smilies, URLS etc.) and be in a raw format.

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..
Reply With Quote
  #7  
Old 04-22-2002, 07:11 AM
Wildthinks's Avatar
Wildthinks Wildthinks is offline
 
Join Date: Apr 2002
Location: .:BeRLiN:.
Posts: 96
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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----
Reply With Quote
  #8  
Old 04-22-2002, 11:39 AM
Wildthinks's Avatar
Wildthinks Wildthinks is offline
 
Join Date: Apr 2002
Location: .:BeRLiN:.
Posts: 96
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Problem:

How can get the date in the right form ?
Can i use php to format from unixtimestamp to readable format?
Reply With Quote
  #9  
Old 04-23-2002, 06:36 PM
Logician's Avatar
Logician Logician is offline
 
Join Date: Nov 2001
Location: inside vb code
Posts: 4,449
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by Wildthinks

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?
I'm not sure if I got the question right? If it's what you asked, here's the answer:

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,
Reply With Quote
  #10  
Old 04-23-2002, 06:41 PM
Logician's Avatar
Logician Logician is offline
 
Join Date: Nov 2001
Location: inside vb code
Posts: 4,449
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by Wildthinks
Problem:
How can get the date in the right form ?
Can i use php to format from unixtimestamp to readable format?
The hack cant format the date (yet). In the next releases I plan to format it automatically inside the script.
Reply With Quote
Reply

Thread Tools
Display Modes

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 02:37 PM.


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.04596 seconds
  • Memory Usage 2,290KB
  • Queries Executed 12 (?)
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
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (5)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)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