PDA

View Full Version : [WEBTEMPLATES HACK:]Share your WebTemplates or WebQueries!


Logician
03-26-2002, 03:00 PM
Dear Friends,

This thread is for sharing your WebTemplates and WebQueries with other WebTemplates Hack (https://vborg.vbsupport.ru/showthread.php?s=&postid=231779) 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 (https://vborg.vbsupport.ru/showthread.php?s=&postid=231779).

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 (https://vborg.vbsupport.ru/showthread.php?s=&postid=231779).

Logician
03-26-2002, 03:19 PM
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 templatequeryon 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 :

everybody6 Admin

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 ----
everybody6 Admin templatequeryon
<!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

indiamike
04-03-2002, 08:32 AM
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

Logician
04-04-2002, 06:33 AM
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

WizyWyg
04-12-2002, 07:54 PM
Hi Logician to quote from the original thread:


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.

Logician
04-12-2002, 08:11 PM
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.

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.. ;)

Wildthinks
04-22-2002, 07:11 AM
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----

Wildthinks
04-22-2002, 11:39 AM
Problem:

How can get the date in the right form ?
Can i use php to format from unixtimestamp to readable format?

Logician
04-23-2002, 06:36 PM
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,

Logician
04-23-2002, 06:41 PM
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.

Wildthinks
04-23-2002, 09:15 PM
thx for help i will use the dateformat from Mysql ... and I hope I solve the problem...

Wildthinks
04-24-2002, 01:45 PM
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

Logician
04-24-2002, 01:54 PM
Originally posted by Wildthinks
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?

Basically this hack is for reading FROM database and listing the returned data in a formatted table only, not for writing to the database. So if you want to modify/insert data you have to write the script that does it and then link it form your webtemplate.

Wildthinks
04-24-2002, 02:00 PM
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

Wildthinks
04-27-2002, 08:13 PM
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...

Logician
04-27-2002, 08:24 PM
I didnt understand what the problem is?!? Can you clarify?

Wildthinks
04-27-2002, 08:35 PM
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

Logician
04-27-2002, 08:52 PM
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..

Wildthinks
04-27-2002, 08:57 PM
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...

-=dm=-
05-01-2002, 12:33 PM
Originally posted by Logician
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
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

Logician
05-01-2002, 02:37 PM
Originally posted by -=dm=-

1: where to add the code above?
2: How do I see where is the user (the whoisonline part)

1- You should insert the code somewhere in your web template.

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

TECK
05-02-2002, 07:55 AM
Originally posted by Wildthinks
- oohh my god.... I have a idea ... I will query only the first Post of every thread and user can answer normally ?!?if you do this, you will end up with 150queries on that page. i made the same mistake with vbHome (lite). is now corrected in the full version. and it does have the comments separated... ;)

-=dm=-
05-02-2002, 11:01 AM
Thanx :)


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.


thats strange only 12 have installed this, cuz this hack is one of the best in my opinion, also easy to install and still advanced hack...why is this still in beta section?

Logician
05-02-2002, 12:09 PM
Originally posted by -=dm=-
why is this still in beta section?
Same reason: The hack had no problems here when I published it. But I posted it in the BETA section anyway, because it has a complicated coding and I wanted some feedback and be sure it has no bugs. Unfortunately I received none. So it stays there..

Thx for the nice comments though..

Wildthinks
05-02-2002, 01:30 PM
Originally posted by Logician

Same reason: The hack had no problems here when I published it. But I posted it in the BETA section anyway, because it has a complicated coding and I wanted some feedback and be sure it has no bugs. Unfortunately I received none. So it stays there..

Thx for the nice comments though..

Your WT works very fine and is cool stuff, IMHO is it a cool "light" CMS and I'm happy that I can use it and you share it with us. It's very great...

NTLDR
05-02-2002, 01:37 PM
Originally posted by Logician

Same reason: The hack had no problems here when I published it. But I posted it in the BETA section anyway, because it has a complicated coding and I wanted some feedback and be sure it has no bugs. Unfortunately I received none. So it stays there..

Thx for the nice comments though..

Perhaps the fact that it is in the beta section is putting people of as they think it could mess up there board, the people who have insalled it know its stable but other users may still consider it risky.

Thats just my $0.02 worth.

Logician
05-02-2002, 02:07 PM
Originally posted by NTLDR

Perhaps the fact that it is in the beta section is putting people of as they think it could mess up there board, the people who have insalled it know its stable but other users may still consider it risky.

Yep, you may have a point..

-=dm=-
05-02-2002, 08:43 PM
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

NTLDR
05-02-2002, 08:53 PM
Originally posted by -=dm=-
I hope I can use it with the v3 when its out otherwise Im not going to upgrade to v3 :D

I have a feeling this isn't going 2 work with vB3, I think thats says it all about what -=dm=- thinks about this hack :D

Logician
05-02-2002, 09:13 PM
Originally posted by NTLDR

I have a feeling this isn't going 2 work with vB3, I think thats says it all about what -=dm=- thinks about this hack :D
-=dm=-'s comment is so nice and flattering that it's now impossible not to convert it to vb3. :laugh: (thx btw!)

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..

NTLDR
05-02-2002, 09:21 PM
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.

Logician
05-03-2002, 05:50 AM
Originally posted by NTLDR
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.
It doesnt matter even if vbulletin totally revokes the entire template system, let alone changing a bit. WebTemplates (although having the name template) has nothing to do with vbulletin templates. They are kept in a non-vbulletin table, they are created/modified in a non-vbulletin code and they are parsed in a non-vbulletin script. So whatever modification is made in the vbulletin template system, will not effect this hack.

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.

Wildthinks
05-05-2002, 01:58 PM
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)

Welcome to Your Web Queries:


_last_10_threads [edit] [remove]
Gets user's last 10 threads from forum database
_letzten10threadsalle1 [edit] [remove]
letzetn 10 threads ?ber alles nur mit gleicher oder kleinerer Userid
_listedlprog [edit] [remove]
Liste normaler Programme
_listedownloads [edit] [remove]
Alle Downloads listen
_listedownloadsSWI [edit] [remove]
Fragt alle Downloads aus der Liste ab
_listedownloadsswi152 [edit] [remove]
Liste aller SWI 152
_listedownloadsswi20 [edit] [remove]
Liste aller SWi 2.x
_privateevents [edit] [remove]
Gets user's recent private calender event list
_privatemessages [edit] [remove]
Read last XX private messages of your forum.
_sponsorAusgaben [edit] [remove]
aussgaben auflisten
_sponsorListe [edit] [remove]
Eingang der Betr?ge
_sponsorRestzeit [edit] [remove]
Restlaufzeit ausrechnen
_sponsorSponsoren [edit] [remove]
Liste der Sponsoren
_sponsorSumme [edit] [remove]
Sponsorstatistik
_StatsAnzahlPM [edit] [remove]
Anzahl PM's
_StatsAnzahlPoll [edit] [remove]
Anzahl der Umfragen
_StatsThreadundVoteRate [edit] [remove]
Anzahl der Bewertungen f?r alle threads


and templatename

Welcome to Your Web Templates:


downloadprogramme (40) [edit] [remove]
downloads (13) [edit] [remove]
downloadsstats (1) [edit] [remove]
DownloadsSWI (71) [edit] [remove]
downloadsswi152 (7) [edit] [remove]
Downloadsswi20 (8) [edit] [remove]
footer (0) [edit] [remove]
header (0) [edit] [remove]
last10threads (122) [edit] [remove]
Nachrichten (3) [edit] [remove]
notallowed (0) [edit] [remove]
notfound (0) [edit] [remove]
PrivateNachrichten (9) [edit] [remove]
Sponsor (161) [edit] [remove]
webquery_help (1) [edit] [remove]
webtemplate_help (1) [edit] [remove]
whoareyou (1) [edit] [remove]
_sponsorEintragen (1) [edit] [remove]
------------------


...what I really need is the possibility to transfer variables from one to next site...
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 !

Wildthinks
05-05-2002, 02:12 PM
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)

Logician
05-05-2002, 05:01 PM
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 :)

Wildthinks
05-05-2002, 06:03 PM
I'm busy on job next week, after that I will send you a "problem" for me ....

I noted it down and will check it in the new release if there will be a new release


wow wow wow... mhhhh please. ... develope this further... i give you all support that i can.... unlikely my skills have not level to develope a programm like webtemplate...

Logician
05-05-2002, 07:02 PM
Originally posted by Wildthinks
wow wow wow... mhhhh please. ... develope this further... i give you all support that i can.... unlikely my skills have not level to develope a programm like webtemplate...
You guys surprise me! :p I published this hack, asked for comments and feedback to develop it more and nobody even tell me if it's working without any problems in their board or not. Only 12 people installed it in 2 months and honestly this hack lost its priority in my list. (I still use it in my board though).

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.

Wildthinks
05-05-2002, 07:48 PM
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...

Wildthinks
05-12-2002, 10:41 AM
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...

Logician
05-12-2002, 06:16 PM
Hiyas,
Originally posted by Wildthinks
1. ??Count(dlm_files.id)?? don't work

Right, use alphanumeric names ONLY. ie. A-Z and 0-9

No ().?*,"' etc..


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) so have you the possibility to insert webtemplates in other...

Wow! you are asking for too much! :)

Yes you cant insert webtemplate inside webtemplate.

You can insert many webqueries inside 1 webtemplates though.


3. to much space between ??var1?? and ??var1??
sample: original Downloads: ??var1?? in html
Downloads: ??var1??

I didnt get that??


4. Wish: include Template in Standardtemplate from VB

It would be a mistake because then hack would be dependable to vb template system and if they change it in the future (v. 3?), hack would be useless.

And there is no need for that either. If you need to use a vb template, simply copy/paste its contents to your webtemplate.


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...

That's right. Header and footers are not designed to be parsed. If you need to run a webquery in header, do not use a header. Just make 1 webtemplate including your header, webtemplates etc and use that one without header.


6. casesensitiv? the names are casesensitiv? sometimes yes sometimes no?

You have already mentioned that, I noted it.. It's not an important bug either. Just always use lower case.. :)

Regards,

Wildthinks
05-12-2002, 06:29 PM
a quote in a quote in a quote (near by kafka :-))
Originally posted by Logician
Yes you cant insert webtemplate inside webtemplate.

don't work on my board only work with header and footer....

You can insert many webqueries inside 1 webtemplates though.

yes


It would be a mistake because then hack would be dependable to vb template system and if they change it in the future (v. 3?), hack would be useless.
And there is no need for that either. If you need to use a vb template, simply copy/paste its contents to your webtemplate.

mhh I have a problem, i will make a news or a portal with vb, but how I can I have the same functions as in VBB?
When I select text from the database, I have the raw text and nothing is substitute..... :-(


That's right. Header and footers are not designed to be parsed. If you need to run a webquery in header, do not use a header. Just make 1 webtemplate including your header, webtemplates etc and use that one without header.

wonderful... no it's right and ok ....


You have already mentioned that, I noted it.. It's not an important bug either. Just always use lower case.. :)

yes i forgot the other key with...do you know what i mean... _-)

you can see the problem with....
_________________________
3. to much space between ??var1?? and ??var1??
sample: original Downloads: ??var1?? in html
Downloads: ??var1??
_________________________
on this site in the downloadstats...
http://swishzone.net/vb/show.php?pg=DLStats
see under datenbankinfo... too many spaces...

Regards have a nice day...

Logician
05-12-2002, 07:57 PM
Originally posted by Wildthinks
don't work on my board only work with header and footer....

I know.. That is what I already told: You cant = can NOT! You read it wrong.. :)


mhh I have a problem, i will make a news or a portal with vb, but how I can I have the same functions as in VBB?
When I select text from the database, I have the raw text and nothing is substitute..... :-(

You really have a enthusiasm for this hack, dont you? lol I dont believe you designed all your site around this hack and now try to use it as a news script! You make me proud, thank you.. :)

However this hack is not designed to be a news script so I dont think it can handle this job very well.. If you need a news script for your site, I can send you another hack of mine (not published here) which is designed just for pulling news threads from your vb db, to your non-vb news page. It can parse smileys etc, so I think it is exactly what you want. You can see it in action in my site's main page (http://www.turkhukuksitesi.com). Site is not english, but you'll get how the script is doing.



3. to much space between ??var1?? and ??var1??
sample: original Downloads: ??var1?? in html
Downloads: ??var1??

Himm I see now. If you didnt create that space intentionaly, it can be a bug.

Logician \\=^))

Wildthinks
05-13-2002, 11:30 AM
Hi Logician,

thx for offer and I will be read carefully (mmhh my bad english :-))
Yes send me your newsscript, I will read and (hope) understand the newsscript .... THX have a nice week ...

Wildthinks
05-24-2002, 11:42 AM
Hi there everybody... the most usefulll hack on VB (IMHO) is webtemplate from Logician... why?
You can all things do to handle query's from mysql without code....
confused?

look at the attachements I have added my
Webtemplates and webquery...

the demonstration see in the attached gif and on my site http://swishzone.net

Screenshots: watch the the red circle
my Portal: ->> Live SwishZone.net (http://swishzone.net)
http://swishzone.net/wt_images/SZO-###001.gif


Live: Downloads (http://swishzone.net/vb/show.php?pg=downloadsswi20)
Image:
Downloadsite (http://swishzone.net/wt_images/SZO-download.gif)

Live:Downloadstats (http://swishzone.net/vb/show.php?pg=DLstats)
Image:
Downloadstats (http://swishzone.net/wt_images/SZO-downloadstats.gif)

My "Sponsor-Site" (yes, my User sponsor me :-... hating Ads
Live: Sponsoren (http://swishzone.net/vb/show.php?pg=sponsor)
Image:
Sponsorsite (http://swishzone.net/wt_images/SZO-sponsor001.gif)
:beard:

Ok, have you any question please post here....

Highlander
05-30-2002, 09:36 PM
so ..i just want to tell you..that i cant see any bug in this amazing hack...i like it and i will integrate in in my Whole site....
but to make things perfect you should release a big Web-Queries-Pack-HAck..with much queries for all users who need some more Web-Queries for the beginning...

Highlander
05-30-2002, 09:54 PM
hi its me again.. i think i know why not much users install this hack..if it is really so..i just show this hack and some results with it..to my 2nd Admin..an I had to explain and explain what mighty this thing could be..and he understood it slowly...maybe ..it missunderstood....but i am very happy that i found this hack, when i sufed the beta hacks....in the next days this hack will change much thing on the rest of my non-Vb sites..but for that i have to move all content on one Webserver..

Ahh there is a questions...it is possible to link Webtemplates and Webqueries from another Webserver ? So it would be very usefull not to move much contents of my site to the Webserver where my Board is.

Logician
05-31-2002, 08:47 AM
Hiyas,
make things perfect you should release a big Web-Queries-Pack-HAck
The possibilities with WebQueries is infinitive. You may want to use millions of different queries from your database just limited with your imagination. Therefore I cant release WebQueries pack, but this thread is for this purpose: You can share your "favorite" webqueries with other users or ask here how to create a webquery that you need in your board but cant figure out how to do it. But the best practise is to learn the usage of SQL query "SELECT". It wont take you more than 30 minutes and you'll see that afterwards, you can do 90% percent of the queries you needed by yourself.

it is possible to link Webtemplates and Webqueries from another Webserver ?
Nope sorry not possible at the moment. If you know PHP, you may regard making modifications in the file "show.php" and then it may be possible, but it will require a lot of modifications.

Actually this design of the hack is intentional: You can command everything about your site from your vb CP and integrate your whole site into vb. So seperating the webtemplates and vbulletin clashes with this purpose. ;)

and he understood it slowly...maybe ..it missunderstood....
I know that this hack is an "advanced hack" and will not charm the newbies. But its power comes from this property of the hack and I really cant make it simplier. I just tried to create an easy installation, similiar usage like in vb templates and pre-made detailed help pages and I really cant think of anything to make the hack more easily comprehended. :)

Regards,
Logician

Highlander
05-31-2002, 08:13 PM
ok..so now i just need the public event webquery..i try to make the private event visible..but it wont works..i cant find the cariables for that..cann someone tell me ??

I know that this hack is an "advanced hack" and will not charm the newbies. But its power comes from this property of the hack and I really cant make it simplier. I just tried to create an easy installation, similiar usage like in vb templates and pre-made detailed help pages and I really cant think of anything to make the hack more easily comprehended.

you are right..but now when the first things finished..my admins just see the power of it..i will xreate an little admin robot..maye with some talking when specific queries are hit..it will be like in TV .. i come to my adminsitration and a voice is talking to me..
n just ikidding..maybe you did not understand what i mean..my abglish is bad !

Logician
06-01-2002, 08:22 AM
Originally posted by Highlander
ok..so now i just need the public event webquery..i try to make the private event visible.
Use the same webquery as "_privateevents" and change the Query Section to:

SELECT eventid, eventdate, subject FROM calendar_events WHERE userid="$user_userid" AND public="1" ORDER BY eventdate DESC;

This query will return public events posted by the viewer. If you want to return all public events according to today's date, you have to wait for the next version, hack does not include "today's date" variable yet, but I'll include it soon..

Highlander
06-01-2002, 07:22 PM
thx...how can i integrate other PHP sites on external webservers? for now i managed it with frames..ist there a way ?

Logician
06-01-2002, 08:21 PM
Originally posted by Highlander
thx...how can i integrate other PHP sites on external webservers?
If what you want is to compile data from other web sites via this hack, nope this cant be possible. Webqueries only compile data from your board's MYSQL database.

Highlander
06-01-2002, 09:38 PM
okaz..that was also mz thinking..
but mz problem now is ..how to get all these queries..i got ideas bot no queries..

for ex.:
Login shown
or
Logout is show
or
last 10 posts

where to search for all these queries..in the php files?

and if so, should i use them exactly so like it writes there ?

Logician
06-01-2002, 09:55 PM
WebQueries are SQL SELECT commands which returns data from your MYSQL database. They are not vb-pages or sections or parts so you can not return eg. login/log out display forms.

However you can return eg. last 10 posts because it's a query to your MYSQL and your database can return SQL results for this query.

Considering the fact that you are very new to SQL queries I strongly suggest (as in my previous post) studying SQL. It has a very simple syntax and you can really improve yourself in less than an hour for many SQL SELECT Queries. There are a lot of SQL tutorials on the internet, checking them out can help you a lot..Also get a script or hack to run SQL commands to get practise in your MYSQL. PHPMyAdmin is free and very nice script..

Highlander
06-02-2002, 07:05 AM
okay thanx i will do soo..maybe you got an usefull links for me ?

i got again another question..its not really right here..but i dont know who to ask..
I coded a Conent Manager, so it right working very fine..i got an Admin Panel to insert Links with description, Screens and even Covers if they are able to get..this type is specially for games..movie..music and much more content....so but now my expierence is not very much i just started to work with SQL and PHP since 3 months ago..and there isnt much practice yet..even i managed to code this little conten managment..but i cant figure som thing out..and i try ..(but wont work) to integrate this little code in vbulletin..if it is able to be integrated..but the most importand i need to change is ( and i cannot manage it :(( ) is all this search queries i got (. examp. list new entries .. or list pcgames..list movies..) are not integrated on one php page..no i dont know how to this..so i created for every search query one php page..and link to it..now i just saw that you can create php pages with many sql in it..you even have to make variables and then link to them to use this queries , right ?..but i cant figure out..mybe you can or would help me a little bit..it would be really nice..i really dont know how to make this run :(

P.S.
Delete this post if its to wrong here....sorry

Highlander
06-02-2002, 08:13 PM
Hi logician..i got another feature to make..but can you help me?

I want in forumID 63 of USERGROUPID2 and USERID56 that all posts are shown LIMIT XX ... .. i will try something..than tell you if it worjks..

Highlander
06-03-2002, 05:39 AM
okay i got it...here is a Web Query you can only get shown Threads from specific User:

SELECT threadid, title, forumid, postusername, dateline FROM thread WHERE postuserid='XX' ORDER BY dateline DESC LIMIT 10

you see the XX above..there you can put a specific USERID of any USER .. the rest of it it is the same as in _LAST_10_THREADS .. copy all text and just change this thing with USERID='XX' thats it..


@Logician
I got a few questions about the board variables:

You wrote in the Help Template hat i can use $count or $user_userid ..$user_userrname as variables to make it shown ..i tried to put variables of the normal Board templates like $registered or wanted to make visible how much threads started today and i used this variables "$forumt" but nothing happend when i use the normal board varibles .. why ..whats wrong..can i not use the variables of the board templates ??

cu...and even thx .. i just love this hack..ia m every day the whole time on it .. to get out dynamic pages..and my users begin to love it !

Logician
06-03-2002, 01:59 PM
Originally posted by Highlander
I got a few questions about the board variables:
You wrote in the Help Template hat i can use $count or $user_userid ..$user_userrname as variables to make it shown ..i tried to put variables of the normal Board templates like $registered or wanted to make visible how much threads started today and i used this variables "$forumt" but nothing happend when i use the normal board varibles .. why ..whats wrong..can i not use the variables of the board templates ??

it depends: Vbulletin has two types of variables: Global and local.
Global variables are produced when ANY vbulletin script runs and are always alive(has a value). For example $bbuserinfo['username'] is a global variable and it always has a value regardless of the vbulletin script running. You can use global variables inside your Web Templates.

However many vb variables are local and they only have a value when a specific script runs. (eg. index.php). $forumt or $registered variables are local and they will only have a value when their parent script runs so they dont work inside WebTemplates..

Ps. As I said in my privous message it's not possible for you to return some sections of vb with this hack. That is, you cant just automatically and easily create "todays birthdays" section in the main page inside a webtemplate like copy/paste or smt. You can however return results from your MYSQL and hack will automatically create tables for them. You can locate these tables easily inside webtemplates. So what you want to integrate should be queried from the MYSQL so as to be integrated into a WebTemplates.

Highlander
06-03-2002, 05:44 PM
okay thx..for the info..

for the site integration i dont want to return some sections of VB..no i got some non vb sites and i tried to use this queries to make web queries and templates to make this pages shown..so i would be able to integrate this non vb sites in my vb .. for example:

i got a tabel named pc_games .. so in this table are 5 rows listed .. 1. id
2.url
3.title
4...and so on..

ok.. i just managed to ask for title..as i make an query:
SELECT FROM pc_spiele order by title DESC ..
so i got now listed all titles in this table .. but how to say in the query to make not only the title visible..also all other data nthis table and to make klickable links of it..like in my php sites..

the tabel pc_spiele is in the same database as vb and webtemplates..and what i try is to integrated a whole non vb site in this webtemplates..but i need a little bit help..if i could get help for the first time..i am able to get manage the rest alone..so if you got time or answers tell it to mee...please

Logician
06-03-2002, 06:05 PM
Query:
SELECT id, url, title FROM pc_spiele order by title DESC

Table Row:
<li><normalfont><a href="££url££">££title££</a>(id=££id££)</normalfont></li>

Take some time with webquery samples that come with the hack, they will help you get the basics..

Highlander
06-03-2002, 07:32 PM
no the writing sxript is already finish and the content managment also..this is not the problem...its only for this specific content managment..but if i finished all and even got time..i will release a similar thing wich will work wqith your template system together..but only if there is interest..

for BETA 0.0.0.0.2
go here :
http://www.spieleplanet.org/vbp/vbb/show.php?pg=spiele

i managed it already to make it visible and first functions are there..but now i just even need some tipps to increase the output ..thats all...really i would be very glad if somebody could help me and tell me some thing i need to know .. ! :)

Logician
06-03-2002, 07:57 PM
Originally posted by Highlander
i managed it already to make it visible and first functions are there..but now i just even need some tipps to increase the output ..thats all...
Pal I really have problems following your language :knockedout:
What do you mean by "increase the output". I tried to guess what you want by checking your webtemplate but couldnt figure out anything. Your webtemplate is fine and working (by the way dont you have the longest webtemplate ever made? lol) and I really cant understand what tip I am asked to give. Sorry pal..

Highlander
06-03-2002, 08:13 PM
sorry i know .. my english is sometimes very bad ..

longest webtemplate *lol*

thats also one thing i want to figure out..now in the original php file .. i could sel comand like "..*php?sel=a" but now i need new sort queries i think..(increasing output *:-)) ) for example..to sort by alphabetical order .. or newest entry and it is able to count klicks on the link (ID`s) or make some other statistics with help of templates ??

Highlander
06-04-2002, 06:18 AM
hmm i think you maybe cant understand my language..lol..sorry for that..

can you help getting some sort options..and how to inster them..should i make for every sorting a new web query..or can i insert different sort queries in and web query ??..if you dont got time to do much help so tell me .. its no matter..but some tipps would be very useful..and i just figured out some things i asked you before..but you should know if you arrive at the next step..there are questions again..and every step i made ... i get more questions..but its fun to get involved in mysql and php .. i like that coding..its really the best to make websites ..

Logician
06-04-2002, 08:28 AM
ok I think I understand what you mean now (was not easy though) :)

I think you want your webtemplates to accept "parameters" like:
url/show.php?pg=whoareyou&sort=threadid

This is requested before (by Wildthinks?) and I'm thinking of adding this future for the new release (btw I'm about to complete it. In fact if I decide not to add this feature, it's already finished) ;)
I have just some concerns about security for this feature, so I dont want to rush and add a security gap, to introduce a new feature. I need some time to ponder about it and if I decide to add it, need more time to design/debug it so as not to impair the code's security.

So I dont promise for this feature, but it's already regarded and you may or may not see it in the new release.

Highlander
06-05-2002, 05:10 PM
hello,

i got a question again..

i need to sort all links from a-z .. should i create evrytime one own query

SELECT id, titel, url, sprache, beschreibung, cover, releaser FROM pcspiele WHERE titel LIKE "a%";

this would mean i need for every section 24 queries to sort by letters..and if i got 4 sections i would have 96 webquerytemplates.

And how should i sort by date ?..when i want specificate to sort by titles wich are 10 days old (for ex.)..

should i also create a webquery template ..or is there a way to get all sort criterias in one webquery ..

this main question would help me out if i could do it in a other way :(

Highlander
06-05-2002, 10:28 PM
hi logician..i think maybe my project cant be done with webtemplates..i just cant figure out some things..so maybe its the best to leave this nonVB pages as they are... the thing is that i dont know the orders to do same things my existing php files do....the code i got on my php files is not working when i put it in the templates.......i will give it some try again...but code like this..what do do with..where should i integrate it ?


<?
$link=split("\n",$row[2]);
foreach ($link as $value)
{
$rest = substr ($value, 0, 4);
if ($rest == 'ed2k')
{
$datei = explode("|",$value);
?>

Logician
06-06-2002, 05:26 AM
Highlander your problem will be solved if my hack can accept "parameters". Then you will be able to send the parameters to your webtemplates, process them in webqueries and get the result you want like sorting your queires according to field X.

However as I said before this hack does not accept parameters at the moment so you cant do what you want easily. You have to create a different query and webtemplate for all your different sorting orders and it will be arduous for you, I wouldnt suggest that.

If I were you I would leave these pages as they are and convert them to webtemplates only if new release of webtemplates accept parameters.

One more point: If you dont need these pages to use vbulletin data (vb security/vb styles etc.) why are you converting already made pages to webtemplates? Webtemplates hack is for integrating you non-vb pages to vbulletin and if these non-vb pages has nothing to do with vbulletin (for example if you dont want them accessed by user group X, etc.) you can leave them as it is. My 2 cents.

Highlander
06-06-2002, 06:24 AM
i just wanted to integrate the whole site in the board..and make some thing only visible to members of my site...so it would be the best to use the USER TABLE of the board...ok and i would manage it at all if i could do this two things with the templates....maybe it would work if we could set our variables and use variables as we want..i just bought some books more this days to figure out some things in queries of sql....and i am very sad not to get this content managment to be integrated...

and i think of the idea...why not to code a content managment for the board..i got also the portal and there is a good link managment to insert links and sort them by much things..like date ..and title..but it will not use my ed2k links ..it only works with http links..so there is really no option at this time ti integrate my little coded content managment :( :( :( ..i am sad now..i just want my link managment integrate in the board .....nobody coded a content managament for the vb wich i could use for my huge link database..thx at all and i will use the webtemplates anyway for other things..and now i will read much books to code my own vb content managment :)

Wildthinks
06-26-2002, 11:24 AM
Hi everybody.... here come a little tutorial for last threads on your mainpage ... demo hier: http://swishzone.net

Ok
1. Install webtemplates from logician :lick:

2. create a query called: _last_10_threads


query name:
_last_10_threads

query:
SELECT thread.title as threadname, thread.threadid, thread.forumid, from_unixtime(post.dateline,'%d.%m.%Y - %H:%i:%s') as dd, left(post.pagetext,80) as pagetxt, post.username, post.userid, forum.forumid, forum.title FROM thread,post,forum where post.threadid=thread.threadid and thread.forumid=forum.forumid and thread.forumid<>20 and thread.forumid<>9 and thread.forumid<>32 order by post.dateline desc limit 10

Description: what you want
no result text: what you want


table row:
<tr id="catportalleft">
<td>
<b><smallfont><a href="$bburl/forumdisplay.php?s=&forumid=??thread.forumid?? title="Klick hier um zum Forum zu kommen">Forum: ??Forum.title??</a></b></smallfont>
<tr>
<td><smallfont><b><a href="$bburl/showthread.php?s=&threadid=??threadid??" title="Klick hier um zum Thema zu kommen"><b><img src="$bburl/https://vborg.vbsupport.ru/images/icons/icon1.gif" valign="bottom" alt="Arrow" border="0">Title: ??threadname??<b></a></b>
<tr>
<td>
<smallfont>??pagetxt??... [<a href="$bburl/member.php?s=&action=getinfo&userid=??post.userid??" title="Profile von ??post.username?? ansehen">??post.username??</a>]</smallfont></td>
</tr>
<tr>
<td bgcolor="{alternate}"><smallfont>
??dd??</smallfont></td>
</smallfont>
<td>
</tr>
</td>
</tr>
<td>-</td>



3. create webtemplate

Templatename: last10threads
pagecount: what you want (0 is good)

Template:
everybody templatequeryon
<table cellpadding="4" cellspacing="1" border="0" width="100%">
<tr id="catportalleft">
<td><normalfont color="#FFF788"><b>Letzten 10 Themen </b></normalfont></td>
</tr>
$_last_10_threads
</table>



4. include wherever you want this:

<?php include ("http://www.yourdomain.de/vbdir/show.php?pg=last10threads"); ?>


That's all and works fine on my site....

The last posts with Date, Poster, Forumname and the first 80 Characters... in this version from Webtemplates dont work the smilies...but Logician is going with the development... i hope :confused:

Logician
06-26-2002, 06:57 PM
Originally posted by Wildthinks
The last posts with Date, Poster, Forumname and the first 80 Characters... in this version from Webtemplates dont work the smilies...but Logician is going with the development... i hope :confused:
Yes new version parses all smilies and bbcodes. It also formats date fields according to page viewer's time settings. But I must say that I liked your approach to convert unix time in MYSQL query. Also it was a nice idea to php include the show.php to another php file (eg. main page). I must confess that I never thought about that before, congratulations! :)

By the way good news: I really added a very nice feature to the new version. It now accepts outside variables from the user and process them inside webtemplates and more importantly in webqueries. So for example you can design a HTML forum which submits info to a webtemplate and the webqueries in this template will be formed dynamically according to the data your form sent. It seems to work fine in the alpha tests but I really need to work on it a little more. It's really a tricky feature but introduces truly amazing number of possibilities that can be done via this hack.

Chris M
06-26-2002, 07:07 PM
If this were achievable, I should call you Chen2:)

I love the WebTemplates/Queries Hack as it is already!!!

BTW : I am working on a great Tutorials Design using it!:)

Satan

Wildthinks
06-27-2002, 06:34 AM
Originally posted by Logician

Yes new version parses all smilies and bbcodes. It also formats date fields according to page viewer's time settings. But I must say that I liked your approach to convert unix time in MYSQL query. Also it was a nice idea to php include the show.php to another php file (eg. main page). I must confess that I never thought about that before, congratulations! :)


THX, see this as a nice example for If-Query in Mysql. That's print different Images...
-----------------------
select (sum(betrag)/69) as rest,if(((sum(betrag)/69)<12),repeat("<img src=""minusmax.gif"" alt=""Sponsormeter..."" name=""Sponsormeter"" id=""Sponsormeter"" border=""0"">",(sum(betrag)/69)),repeat("<img src=""plus.gif"" alt=""Sponsormeter..."" name=""Sponsormeter"" id=""Sponsormeter"" border=""0"">",(sum(betrag)/69))) as images from sponsoring
----------------------------

By the way good news: I really added a very nice feature to the new version. It now accepts outside variables from the user and process them inside webtemplates and more importantly in webqueries. So for example you can design a HTML forum which submits info to a webtemplate and the webqueries in this template will be formed dynamically according to the data your form sent. It seems to work fine in the alpha tests but I really need to work on it a little more. It's really a tricky feature but introduces truly amazing number of possibilities that can be done via this hack.
I 'll be waiting for betatest, Sir! :squareeyed:

Logician
06-27-2002, 01:54 PM
Originally posted by Wildthinks

I 'll be waiting for betatest, Sir!
The script is ready for the beta test but I need to write the instructions for both usage of the new features and upgrading.. New added features made old help files obsolete and there are many things to add into usage documents so it takes time. (BTW I just hate to write help files for hacks, it's too boring!). I'm also exploring the new features especially regarding the outside variables. I really enjoy the things that can be done with them, it's just exicting. For instance I've just thought that we may be able to pull vb polls (latest, last X, any, all) outside vb, with outside variables and conditionals. Himm excuse me, I need to test that now.. :glasses:

Wildthinks
06-27-2002, 03:36 PM
yes, of course... right.. I'm waitung for it...

I plan a VB-based Guestbook with webtemplates... you can see it in VB as espacially forum or thread and in the mainpage as "normal" GB with all features from vb - like search, smilies, vbcodes etc... :smoke: :alien: :nervous: :bunny:

Chris M
06-28-2002, 12:16 PM
Cool...

I volunteer to be a beta tester if you need any!!!

Satan

mbaskett
07-22-2002, 03:24 AM
Logican, I love this hack! it's exactly what we were looking for while re-designing our site. I've already clicked the 'install' button for ya, even though we're still in beta testing on the upcoming site relase! I'm that confident ath we won't see any problems with it.

Just and FYI, I did change your code in a couple of places, primarily to use the header and footer templates within our vb styles, but also to work with phpAdsNew. I know you have your copyright in your webtemplate footer, and we don't currently have something similar in in our vb footer templates, but that was the easiest way I found to allow our header and footer change with the user's styles. I am, however quite pleased with this hack, and will be giving you due credit in our 'Credits and Copyrights' page (which will probably be a webtemplate page ;)

Keep up the great work....

I'm going to read through this thread to see what other info there may be in here.... possibly post some of the things we've created eventually....

Cheers!

Logician
07-22-2002, 08:01 AM
Originally posted by mbaskett
even though we're still in beta testing on the upcoming site relase! I'm that confident ath we won't see any problems with it.

You dont need to worry. Although the hack version is named "beta", in fact it's tested for a long time and proven to be quite stable. I know sites that are completely powered by this hack only, so you wont encounter any problems..

Originally posted by mbaskett

Keep up the great work....

Please let me know if you are interested in testing the new version before the release. I can use some help if you or other hack users can give the new version a try and send me feedback about it. I cant promise it's as stable as this version since I have added a lot of new features and it's still in progress. However if your site is powered by webtemplates, you are very likely to like the new version a lot..

mbaskett
07-22-2002, 03:42 PM
I know! ;)

I meant our site a whole is still in beta... as we have not publicly released our new changes (My testing of Webtemplates is pretty much complete, and it came out with 5 stars + my dev staff loved it!)

I'd love to test the latest version! I will let you know that I am currently working on developing our current site layout, with the older version of webtemplates.... how easy is the upgrade process?

Let me know what I need to do to help you out!!!!! The least I can do is put it on one of our dev servers and test it! If it comes out stable (or we make it stable;)) then I'll be quick to put it into our production environment!

Logician
07-23-2002, 07:27 AM
Originally posted by mbaskett
I'd love to test the latest version! I will let you know that I am currently working on developing our current site layout, with the older version of webtemplates.... how easy is the upgrade process? Let me know what I need to do to help you out!!!!!
Please provide me with your email so that I can send you the new version.

Upgrade is easy: You dont need to modify any tables since new version uses the same tables. I just removed the hack from templates.php file and release it as a new file on its own so that further updates can be easier so all you have to do is to remove the section from templates.php and upload a new file. There are also tiny editing in index.php and online.php (so that your webtemplates visitors will be displayed in who is online list correctly.)

New version is fully competible with the older version so you can use your existing webtemplates and webqueries without any modifications.

I appreicate if you can test it and give me feedback (+suggestions). I especially want it be tested regarding "outside variable" feature. It lets your webtemplate accept variables via URL address bar or form POST/GET methods and with the help of conditionals you can create very powerful webtemplates and webqueries. I double checked everything especially regarding "security" but it would be great some other people who is familiar with the concept take a look of the algorithm too. So your dev.team's check would be great.. ;) Thanks..

mbaskett
07-25-2002, 08:31 PM
check your PM's...

Once I get it, I'll get it up and online and being our testing phases....

mbaskett
07-26-2002, 05:30 PM
Just a quickie here...

I got the new version up and started some basics of config and whatnot... Of course I re-edited the show.php to use the vb header and footer templates, as well as working with our PHPAdsNew implementation.

First impressions:

Like the new adminCP setup. Having a seperate file is a bit nicer. I *think* I did the upgrade steps properly, btu was a bit unclear if I should have removed the webqueries code from tempate.php or if it was just the webtemplates code....

I did a small bit of tweaking of webtemplate.php so that the layout in the adminCP is a bit clearer. Most of it was because all our webtemplates are ordered based on their name, which we use for organization and sorting, etc.

The code below also keeps a small bit of code from being repreated.. I know it's minor, but it can play a role on page load time when you are listing MANY templates....


// ###################### Start weblist #######################
if ($action=="weblist") {

echo '<table width="100%" border="1" cellspacing="0" cellpadding="0"><tr><td style="BACKGROUND-COLOR: #cecfce; border: 2px outset; padding-left: 3px; FONT-FAMILY: Verdana, MS Sans Serif; FONT-SIZE: 11px; text-align: center;"><div align="center"><font size="4"><b>Your Existing Web Templates:</b></font></div></td></tr><tr><td>';
echo '<table width="100%" border="0" cellspacing="0" cellpadding="0">';
$log_webtitles=$DB_site->query("SELECT templateid, title,count FROM webtemplates ORDER BY title");
while ($tumsatir=mysql_fetch_row($log_webtitles))
{
$iii++; if ($iii%2==0) {$tbbgcolor='#F1F1F1';} else {$tbbgcolor='#DFDFDF';}
echo '<tr bgcolor="'.$tbbgcolor.'"><td width="30" align="right">';
echo "$iii- </td><td align=left><b>$tumsatir[1]</b></td><td> - $tumsatir[2] visits ". makelinkcode("edit","webtemplate.php?s=$session[sessionhash]&action=webedit&templateid=$tumsatir[0]").
makelinkcode("remove","webtemplate.php?s=$session[sessionhash]&action=webremove&templateid=$tumsatir[0]").
makelinkcode("visit","$bburl/show.php?s=$session[sessionhash]&pg=$tumsatir[1]").
makelinkcode("download","webtemplate.php?s=$session[sessionhash]&action=webtemplatedownload&templateid=$tumsatir[0]")."\n";
echo '</td></tr>';
}
echo '</table>';
echo '<tr><td>[<a href="webtemplate.php?s='.$session[sessionhash].'&action=webadd">Add a New WebTemplate<a/>]</td></tr>';
echo '<tr><td style="BACKGROUND-COLOR: #cecfce; border: 2px outset; padding-left: 3px; FONT-FAMILY: Verdana, MS Sans Serif; FONT-SIZE: 11px; text-align: center;"><b>WebTemplates & WebQuery Hack</b> by <i>Logician</i> \\\\=^))</tr></td>';
echo '<tr><td><div align="center"><small><a href="'.$webtemplates_helpurl.'" target="_blank">WebTemplates Help Page - <a href="'.$webqueries_helpurl.'" target="_blank">WebQueries Help Page</a> - <a href="https://vborg.vbsupport.ru/showthread.php?s=&threadid=36419" target="_blank">Vbulletin.org Thread</a> - <a href="https://vborg.vbsupport.ru/showthread.php?s=&threadid=36578" target="_blank">Share Your WebQueries</a></div></td></tr></table>';
echo '<li><small>"notallowed" template is loaded, if visitor tries to access an unallowed page and "notfound" template is shown, if the requested page does not exist.</small></li>';



} //if ($action=="weblist")

Logician
07-29-2002, 07:07 AM
Originally posted by mbaskett
was a bit unclear if I should have removed the webqueries code from tempate.php

It's not important. After the upgrade, hack codes in template.php become obsolete and will not be used again. So best practise is to delete them, but if you dont, its no big deal, they are harmless in there..

I did a small bit of tweaking of webtemplate.php so that the layout in the adminCP is a bit clearer. Most of it was because all our webtemplates are ordered based on their name, which we use for organization and sorting, etc.
So you changed sort order?

mbaskett
07-30-2002, 07:57 PM
Originally posted by Logician

It's not important. After the upgrade, hack codes in template.php become obsolete and will not be used again. So best practise is to delete them, but if you dont, its no big deal, they are harmless in there..
Fair enough ;)


So you changed sort order?

I don't believe the order itself was changed, just the formatting. Removed a <table> tag that was being looped through for coding sake (basically each template in the list was showing up in own table. While it was not visually noticable, the simple creation of the table,tr,td, /td,/tr,/table tags for EACH template in the list was inefficient... so instead I changed it to one table with the tr,td,/td,/tr tags being looped through.

I've also added one addition function to the hack as of now... a description field. We plan on using this for menu population (as our template names are probably not visually appealling to see in auto-populated menus....) more on this later once it's all completed and in the testing phases.

Rose
07-30-2002, 08:05 PM
I installed this a day or three ago. Love it so far! (I posted in the hack thread regarding some specific questions).


I just added Wild Thinks query/last ten threads and modified it abit. :D Works nice. However, I'm interested in this "new version" that parses vbcode. Right now it shows the [ quote ] tags and such if they are at the beginning of the post.


edited to add - Is there anyway to NOT show posts in private forums on the site's "last ten posts"? I don't want links to the moderator's lounge popping up (granted, mebmers can't get in, but let's not flaunt it!).

Any ideas? Query modifications?

Rose
07-30-2002, 08:58 PM
Also, on my site I have the "Welcome back, Username" here. For unregistered members/guests - how would I include a login panel for them?

Logician
07-31-2002, 07:42 AM
Rose,
Originally posted by Rose
I just added Wild Thinks query/last ten threads and modified it abit. :D Works nice. However, I'm interested in this "new version" that parses vbcode. Right now it shows the [ quote ] tags and such if they are at the beginning of the post.

The new version is in progress.. In fact I sent them to some power users so that they can return me comments and it's proved to be working ok. But I cant guarantee it has no bugs at the moment and I cant support it until I release it. So if this is not a problem for you and want to test it out, drop me your mail address and I'll send it to you. If you want to have the "stable" and "final" version, you have to wait until it's released..

edited to add - Is there anyway to NOT show posts in private forums on the site's "last ten posts"?

Sure you have to modify Wildthinks query a bit: Replace XXX, YYY and ZZZ with forumids in the query below to exclude these forums:

SELECT thread.title as threadname, thread.threadid, thread.forumid, from_unixtime(post.dateline,'%d.%m.%Y - %H:%i:%s') as dd, left(post.pagetext,80) as pagetxt, post.username, post.userid, forum.forumid, forum.title FROM thread,post,forum where post.threadid=thread.threadid and thread.forumid=forum.forumid and thread.forumid<>XXX and thread.forumid<>YYY and thread.forumid<>ZZZ order by post.dateline desc limit 10

Also, on my site I have the "Welcome back, Username" here. For unregistered members/guests - how would I include a login panel for them?
You can use a "conditional" like this:
[[($bbusergroupid==1)]]
Copy paste the login form's HTML code here.
[[/($bbusergroupid==1)]]

It's like the hidden text in my sample webtemplate. If the user is unregistered/unloggedin, this conditional will be parsed and he'll get the code in between. If he is a loggedin member, he wont see that part in the webtemplate.. ;)

Rose
07-31-2002, 02:07 PM
Thank you, Logician! I've changed the query so that my private forums info stays private. :D

But I'm still having trouble using the login form. DkrFusion gave me the code to have it say Welcome Back "so and so" - but even when I'm logged in I see "Unregistered". Logged into the forums, anyway. I can't seem to ever be "logged into" the site - yet I can't logout and see the login box what I put in according to your instructions. Any ideas? *hehe*

Logician
07-31-2002, 02:18 PM
Originally posted by Rose
But I'm still having trouble using the login form. DkrFusion gave me the code to have it say Welcome Back "so and so" - but even when I'm logged in I see "Unregistered". Logged into the forums, anyway. I can't seem to ever be "logged into" the site - yet I can't logout and see the login box what I put in according to your instructions. Any ideas? *hehe*
I think I didnt get it right? Can you please post the webtemplate (or the relevant part) that you are talking about. And clarification on what exactly you are trying to achieve on this webtemplate can also help.. :knockedout:

Rose
07-31-2002, 02:30 PM
Originally posted by Logician

I think I didnt get it right? Can you please post the webtemplate (or the relevant part) that you are talking about. And clarification on what exactly you are trying to achieve on this webtemplate can also help.. :knockedout:

*hehe* Sure - here's what I'm doing. On the index page of the site, I want it to welcome back each member by name - or if they aren't logged in or registered - a login box would be provided.


Here's the code I'm working with - it may be off, but it's what I got:


(quoted in php because.....I thought it'd be better that way?)


<!-- Left Column Body Start -->
<td valign="top" width="200"><table bgcolor="#F6EDCA" cellpadding=5 cellspacing="1"><tr width=100% height=100%><td background="http://www.thesistersthree.com/site/headerbg.jpg" align=center>
<font face=verdana color="#FBF5E1" size=1><b>Welcome Back $user_username</b></font></td></tr>
<tr><td bgcolor=#330000">
[[($bbusergroupid==1)]]
<form action="member.php" method="post">
<tr>
<td nowrap><smallfont><b>Not cookied?</b><br>Login with username and password:</smallfont></td>
</tr><tr>
<td nowrap><input type="hidden" name="s" value="$session[sessionhash]">
<input type="hidden" name="action" value="login">
<input type="text" class="bginput" name="username" size="7">
<input type="password" class="bginput" name="password" size="7">
<input type="submit" class="bginput" value="Login!"></td>
</tr>
</form>

[[/($bbusergroupid==1)]]</td></tr>

<tr>
<td bgcolor="#330000"><font face=verdana color="#FBF5E1" size=1>
<a href="http://www.thesistersthree.com/forums/usercp.php?"><center><b>My Control Panel</b></center></a><br>

Logician
07-31-2002, 07:12 PM
Originally posted by Rose

*hehe* Sure - here's what I'm doing. On the index page of the site, I want it to welcome back each member by name - or if they aren't logged in or registered - a login box would be provided.

ok I see your problem: Use conditional in this format:

[[($bbuserinfo[usergroupid]==1)]]

Of course closing conditional will be replaced too:
[[/($bbuserinfo[usergroupid]==1)]]

Rose
07-31-2002, 07:29 PM
Originally posted by Logician

ok I see your problem: Use conditional in this format:

[[($bbuserinfo[usergroupid]==1)]]

Of course closing conditional will be replaced too:
[[/($bbuserinfo[usergroupid]==1)]]


That seems to allow the code to show up! Now that I have it so a member can login, how can I get it to return them to the site page, not the forums page?

Also, I'm still having problems with the "Welcome Back ....." as no matter if a member is logged in or out - it still says unregistered and displays the Unregistered name. However, the "My control Panel" link is working. :s

Oh the frustrations! *hehe* This is a great addition/hack, Logician. I really do hope it works out well as it seems to be so far, minus the few tricks here and there.

You've mentioned how with queries it is endless, which is why a list of helpful queries hasn't been posted. However, I've only seen one that has shared so far (the last ten posts). I'm interested in doing more with this hack, but I can't write my own queries just yet. Is there any plans to release some basics to choose from so we can modify them to fit? Suggestions and such?

Logician
08-01-2002, 07:10 AM
Originally posted by Rose
That seems to allow the code to show up! Now that I have it so a member can login, how can I get it to return them to the site page, not the forums page?

Do you need your member to login first before she can display the page? Then why dont you simply use 1 tag inside your webtemplate? I guess this will do the trick for you: if she is unregistered/unloggedin she'll get "not allowed" (together with login) page and if she is registered/loggedin she can view the template. What do u think about this solution?

Also, I'm still having problems with the "Welcome Back ....." as no matter if a member is logged in or out - it still says unregistered and displays the Unregistered name.
Your format seems correct. Are you sure you are visiting the template after you logged in? Maybe you can create a member account for me in your site (pls pm username and password and template name to me) and let me check it..

You've mentioned how with queries it is endless, which is why a list of helpful queries hasn't been posted. However, I've only seen one that has shared so far (the last ten posts). I'm interested in doing more with this hack, but I can't write my own queries just yet. Is there any plans to release some basics to choose from so we can modify them to fit?
The problem is I dont have time for all: I develop the new version, I give support for the hack and I have many other released hacks which I also give support. Yes it would be nice if some basic webquery samples would be released (for which this thread is created) but it would be nicer if some of the hack users who can do it would share theirs for all of us instead of waiting me to do everything. ;)

I'm hoping that this problem would be solved in the new version to a certain extent. I integrated "download webquery/webtemplate" feature into the new version and with one click you would be able to create a text file with how to install installations of your webtemplates and webqueries. So all you have to do is to attach this file in a reply in this thread. Therefore I'm hoping that sharing traffic would get higher after this release. Hopefully..

Rose
08-01-2002, 01:06 PM
Originally posted by Logician
Do you need your member to login first before she can display the page? Then why dont you simply use 1 tag inside your webtemplate? I guess this will do the trick for you: if she is unregistered/unloggedin she'll get "not allowed" (together with login) page and if she is registered/loggedin she can view the template. What do u think about this solution?

I think I'll try it and see if it works! :D Will edit this post afterwards. ;)
Edited to say: - Okay. I've added the cansee/cantsee bit. Now it takes me to login. Making progress. :D However, when I login, it calls for /site/member.php (when obviously it's in the /forums directory). I can't copy member.php to the site folder because that doesn't work, either. How do I get it to call from the forums directory (I thought I had that done).

Your format seems correct. Are you sure you are visiting the template after you logged in? Maybe you can create a member account for me in your site (pls pm username and password and template name to me) and let me check it..
I'm sure I'm logged into the forums. I'm not sure if I'm logged into the website - I would assume they both use the same stuff, though. I'll pm you specifics as soon as I can with pass/user.


The problem is I dont have time for all: I develop the new version, I give support for the hack and I have many other released hacks which I also give support. Yes it would be nice if some basic webquery samples would be released (for which this thread is created) but it would be nicer if some of the hack users who can do it would share theirs for all of us instead of waiting me to do everything. ;)

I'm hoping that this problem would be solved in the new version to a certain extent. I integrated "download webquery/webtemplate" feature into the new version and with one click you would be able to create a text file with how to install installations of your webtemplates and webqueries. So all you have to do is to attach this file in a reply in this thread. Therefore I'm hoping that sharing traffic would get higher after this release. Hopefully..
I understand. I guess I shall start taking a more proactive stance here, start writing a few things and seeing if they work, and then contribute! :D That will be on my todo list. *nods* And your plans for the next release sounds grand. :D

Craigr
02-23-2003, 04:26 PM
Anybody want to share some more queries?

Craig

Craigr
03-30-2003, 03:55 PM
Hi,

Is there any way someone could write a query that i could use in the templates.

I want a query that extracts the last 5 posts from a thread and displays part of it say the first few hundred characters. If possible also displays the posters name and time posted.

I managed to alter Pluh News to do this, but you can't include php files in Webtemplates.

Thanks
Craig

Logician
03-30-2003, 06:18 PM
Today at 07:55 PM Craigr said this in Post #95 (https://vborg.vbsupport.ru/showthread.php?postid=375541#post375541)
I want a query that extracts the last 5 posts from a thread and displays part of it say the first few hundred characters. If possible also displays the posters name and time posted.

here you go:

Craigr
03-30-2003, 06:40 PM
Today at 08:18 PM Logician said this in Post #96 (https://vborg.vbsupport.ru/showthread.php?postid=375597#post375597)

here you go:

Works great. :D

Thanks once again.
Craig

amykhar
04-22-2003, 03:05 PM
I threw this together to satisfy my own curiousity. (Thanks to zzed for a tip that helped me do this).

It's not really a finished hack. It's more of a rough job that lets me see what I want to see. As the table grows, I will manually drop older information as needed.

Run this query:
SQL-query : [Edit] [Create PHP Code]
CREATE TABLE `Google` (
`googleid` TINYINT NOT NULL AUTO_INCREMENT,
`url` VARCHAR( 255 ) NOT NULL ,
PRIMARY KEY ( `googleid` )
);


In global.php Find:


$header='';
$footer='';


Add After :

if(strstr($url, "google")) {
$DB_site->query("INSERT INTO Google VALUES (null, '$url')");
}



OK. Now for the Web Templates part:

Create a new query:

Query name: _google
Query: Select url from Google;
Description: Figure out what people are searching for on Google
No result Text: none
Table Row:<li><a href="??url??">??url??</a></li>


Create a new Web Template:
Template name: Google
Page Count: 0
(You will need to tweak this to your taste. I kept mine bare bones and allow anyone who knows about it to see it) Template:
everybody
templatequeryon
<ol>
$_google
</ol>

Demo:
http://www.eaforums.com/forums/show.php?pg=test

Have fun :)

Logician
04-22-2003, 07:14 PM
it is handy, thx for sharing! :)

mzbcarper
05-21-2003, 02:48 PM
Hello, i want to include the username on my custom page, how could i manage this ?

greez

mzbcarper

amykhar
05-21-2003, 03:43 PM
Bug found in my above post. Make googleid an Int instead of a tinyint.

Amy

Koutaru
05-21-2003, 05:59 PM
Today at 10:48 AM mzbcarper said this in Post #100 (https://vborg.vbsupport.ru/showthread.php?postid=398102#post398102)
Hello, i want to include the username on my custom page, how could i manage this ?

greez

mzbcarper



ask in the original thread
and check in your admincp or readme. it should be there

glo
08-02-2003, 02:19 AM
Hi Logician,

I can see that this thread hasnt been very active since May.

I have installed your new version 2.03 and have 2 questions requiring your assistance.

I hope that from the answers obtained I will be able to contribute to the webquery and template list!

1. this question is similar to Rose's question from 1 year ago.
Objective: When a guest or member who is not logged in, accesses the "account information" page, the page should display (using conditionals) some text about membership benefits . But once they log in then they are given the "edit profile, edit options and edit password" templates from vB but i dont want to use the vB header.

What is the best way to do this?

2. I will think of the 2nd question when we sort out the first one.

Thanks again! Eagerly awaiting your response.

Logician
08-02-2003, 09:13 AM
Today at 06:19 AM glo said this in Post #103 (https://vborg.vbsupport.ru/showthread.php?postid=422525#post422525)
Hi Logician,

I can see that this thread hasnt been very active since May.

I have installed your new version 2.03 and have 2 questions requiring your assistance.

I hope that from the answers obtained I will be able to contribute to the webquery and template list!

1. this question is similar to Rose's question from 1 year ago.
Objective: When a guest or member who is not logged in, accesses the "account information" page, the page should display (using conditionals) some text about membership benefits . But once they log in then they are given the "edit profile, edit options and edit password" templates from vB but i dont want to use the vB header.

Create a custom header for your webtemplates. Set "Have conditionals" to "YES" for your header.

Then use conditionals to display certain things according to visitor's userid/usergroupid there.

---------------------------------------------------------------
HTML that is showed to both guests and members

[[($bbuserinfo[userid]==0)]]
HTML to show guests only
[[/($bbuserinfo[userid]==0)]]

HTML that is showed to both guests and members

[[($bbuserinfo[userid]>0)]]
HTML to show to members only
[[/($bbuserinfo[userid]>0)]]

HTML that is showed to both guests and members
---------------------------------------------------------------
Then assign this to any webtemplate you like. More examples about conditionals can be found in the hack threads of "Dynamic Templates Hack" and "Dynamic Forum Home Announcement Hack".

glo
08-02-2003, 11:30 AM
How is this? Does it look correct?

__________________________________________________ __
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
$nowbrowsing <br><br>

[[($bbuserinfo[usergroupid]>1)]]

<head>
<title>$bbtitle - Update profile</title>
$headinclude
</head>
<body>

<!-- breadcrumb -->
<table cellpadding="2" cellspacing="0" border="0" width="95%" align="center">
<tr>
<td width="100%">
<normalfont><b>&gt;
<a href="usercp.php?s=$session[sessionhash]">User Control Panel For $bbuserinfo[username]</a> &gt;
Edit Profile</b></normalfont></td>
</tr>
</table>
<!-- /breadcrumb -->

<br>
$cpnav
<br>

<center>$coppatext</center>

<form action="member.php" method="post">
<input type="hidden" name="s" value="$session[sessionhash]">

<table cellpadding="0" cellspacing="0" border="0" bgcolor="#0A293E" width="95%" align="center"><tr><td>
<table cellpadding="4" cellspacing="1" border="0" width="100%">
<tr>
<td bgcolor="#336D95" background="https://vborg.vbsupport.ru/images/catagory_backing.gif" colspan="2"><normalfont color="#000000"><b>Edit Profile - $bbuserinfo[username]</b></normalfont></td>
</tr>
<tr>
<td bgcolor="#1D6AA0" colspan="2"><normalfont color="#EEEEFF" class="thtcolor"><b>Registration: Required Information</b></normalfont>
<smallfont color="#EEEEFF" class="thtcolor">All fields are required.</smallfont></td>
</tr>
$parentemail
<tr>
<td bgcolor="#1C5780"><normalfont><b>Email Address:</b></normalfont></td>
<td bgcolor="#1C5780"><normalfont><input type="text" class="bginput" name="email" value="$bbuserinfo[email]" size="30" maxlength="150"></normalfont></td>
</tr>
<tr>
<td bgcolor="#1C5780"><normalfont><b>Confirm Email Address:</b></normalfont></td>
<td bgcolor="#1C5780"><normalfont><input type="text" class="bginput" name="emailconfirm" value="$bbuserinfo[email]" size="30" maxlength="150"></normalfont></td>
</tr>
$customfields_required
<!-- *** -->
<tr>
<td bgcolor="#1D6AA0" colspan="2"><normalfont color="#EEEEFF" class="thtcolor"><b>Optional Information</b></normalfont> <smallfont color="#EEEEFF" class=thtcolor>All information will be viewable by other $bbtitle members.</smallfont></td>
</tr>
<tr>
<td bgcolor="#1C5780"><b><normalfont>Homepage:</normalfont></b></td>
<td bgcolor="#1C5780"><normalfont><input type="text" class="bginput" name="homepage" value="$bbuserinfo[homepage]" size="30" maxlength="200"></normalfont></td>
</tr>
<tr>
<td bgcolor="#13486D"><b><normalfont>ICQ Number:</normalfont></b></td>
<td bgcolor="#13486D"><normalfont><input type="text" class="bginput" name="icq" value="$bbuserinfo[icq]" size="30" maxlength="30"></normalfont></td>
</tr>
<tr bgcolor="#1C5780">
<td><b><normalfont>AOL Instant Messenger Handle:</normalfont></b></td>
<td><normalfont><input type="text" class="bginput" name="aim" value="$bbuserinfo[aim]" size="30" maxlength="30"></normalfont></td>
</tr>
<tr>
<td bgcolor="#13486D"><b><normalfont>Yahoo Messenger Handle:</normalfont></b></td>
<td bgcolor="#13486D"><normalfont><input type="text" class="bginput" name="yahoo" value="$bbuserinfo[yahoo]" size="30" maxlength="30"></normalfont></td>
</tr>
<tr>
<td bgcolor="#1C5780" valign="top"><b><normalfont>Signature:</normalfont></b><br>
<smallfont>Optional signature you may use to appear at bottom of your posts.</smallfont>
<p><smallfont>HTML code is $htmlonoff<br>
<a href="misc.php?s=$session[sessionhash]&action=bbcode">vB Code</A> is $bbcodeonoff<br>
[img] code is $imgcodeonoff<br>
<a href="misc.php?s=$session[sessionhash]&action=showsmilies">Smilies</a> are $smiliesonoff
</smallfont></p></td>
<td bgcolor="#1C5780"><textarea name="signature" rows="6" cols="40">$signature</textarea></td>
</tr>
$birthday
$customtext
<tr>
<td bgcolor="#1D6AA0" colspan="2"><normalfont color="#EEEEFF" class="thtcolor"><b>Additional Information</b></normalfont></td>
</tr>
$customfields
</table>
</td></tr></table>

<br>

<table cellpadding="2" cellspacing="0" border="0" width="95%" align="center">
<tr>
<td align="center"><normalfont>
<input type="hidden" name="action" value="updateprofile">
<input type="submit" class="bginput" name="Submit" value="Submit Modifications" accesskey="s">
<input type="reset" class="bginput" name="Reset" value="Reset Fields">
</normalfont></td>
</tr>
</table>

</form>

$footer

</body>

[[/($bbuserinfo[usergroupid]>1)]]

[[($bbuserinfo[usergroupid]==1)]]

<font face="Verdana, Arial, Helvetica, sans-serif" size="1">
<b>Welcome to GLO-Racing.com!</b><br><br>
If you dont' have an account already, you can create an account online and become a GLO-Racing.com member. Its <b>FREE</b>!<br><br>
When you are become a GLO-Racing.com member, you can <b>access member only</b> pages, be notified of <b>special offers</b> before the public, <b>earn points</b> for <b>prizes</b>, register for <b>competitions</b>, edit your profile, be a part of the <b>GLO Racing Forums</b> and much much more.</p>

Insert images of member only pages (thumbnails only, cometitions page,</p>

We will not disclose your personal information to any 3rd parties. Please read our Privacy Policy for more details.</p>
Note: Once you have completed the registration form, an email will be sent to the email address that you registered with. Your account will not be activated until you visit the link in that email.</p>

Simply click the relevant link at the top of this page to start!
</font>
[[/($bbuserinfo[usergroupid]==1)]]

</html>
__________________________________________________

for a webtemplate?
I have to add the queries too! But they are all exisiting vb queries, so i just need to add them to the webquery list, right?

I have compiled my webquery for this template!
$nowbrowsing $cpnav $bbuserinfo[userid] $bbtitle $headinclude $session[sessionhash] $bbuserinfo[username] $coppatext $parentemail $bbuserinfo[email] $customfields_required $bbuserinfo[homepage] $bbuserinfo[icq] $bbuserinfo[aim] $bbuserinfo[yahoo] $htmlonoff $bbcodeonoff $imgcodeonoff $smiliesonoff $birthday $customtext $customfields $footer $bbuserinfo[usergroupid]

All up 23 queries from my count. Is that too many?
How am i going so far?

glo
08-07-2003, 09:14 AM
Logician? Any assistance on this one please?

Logician
08-07-2003, 01:00 PM
08-02-03 at 03:30 PM glo said this in Post #105 (https://vborg.vbsupport.ru/showthread.php?postid=422587#post422587)
I have to add the queries too! But they are all exisiting vb queries, so i just need to add them to the webquery list, right?

I have compiled my webquery for this template!
$nowbrowsing $cpnav $bbuserinfo[userid] $bbtitle $headinclude $session[sessionhash] $bbuserinfo[username] $coppatext $parentemail $bbuserinfo[email] $customfields_required $bbuserinfo[homepage] $bbuserinfo[icq] $bbuserinfo[aim] $bbuserinfo[yahoo] $htmlonoff $bbcodeonoff $imgcodeonoff $smiliesonoff $birthday $customtext $customfields $footer $bbuserinfo[usergroupid]

All up 23 queries from my count. Is that too many?
How am i going so far?
Some of these are webtemplates variables (eg. $nowbrowsing), some of them are vb variables ($bbuserinfo[userid] $bbtitle $headinclude $session[sessionhash] $bbuserinfo[username]), some of them are vb templates but none of them are webqueries.

Webquery is a different concept which means SQL queries you created with this hack. It has nothing to do with things you mentioned here.

glo
08-07-2003, 09:57 PM
ok, in that case i will remove the $nowbrowsing and also ($bbuserinfo[userid] $bbtitle $headinclude $session[sessionhash] $bbuserinfo[username] from the webqueries list and place these into the Outside Variables section in the "edit webtemplate" screen.

Anything else i need to do, to make it work properly?

glo
08-07-2003, 10:36 PM
i have removed the all of the variables, and the template still views the same as before, yet there are some parts of the template that i cant get to display.

Basically, my template im creating is a simplified version of the "vb" "editoptions" template without the header (removing header is easy with WT!) but i cant see the cpnav and additional information at the bottom.

Can you guide me please?

Logician
08-08-2003, 08:50 AM
Today at 02:36 AM glo said this in Post #109 (https://vborg.vbsupport.ru/showthread.php?postid=424182#post424182)
i have removed the all of the variables, and the template still views the same as before, yet there are some parts of the template that i cant get to display.

Basically, my template im creating is a simplified version of the "vb" "editoptions" template without the header (removing header is easy with WT!) but i cant see the cpnav and additional information at the bottom.

Can you guide me please?
You can not display every vb template or vb variable in webtemplates by simply adding its name. Some of the variables or templates are produced by vbulletin by running some codes first. And these codes are embedded inside vb scripts. Webtemplates can not display them by just adding its template/variable name as this codes do not run when you call your webtemplates so variable values become blank.

For instance consider quick jump navigation. It has a template and a variable name but adding its template or variable name in webtemplates would not make it appear in your webtemplates. Because vb first runs a special code for it in every page and these codes forms its variable according to many criteria. Like show private forums if user is a admin etc.

Webtemplates still has a structure for creating such special variables and templates but it is for advanced users only. People who is proficient in PHP can check vbulletin's algorithm for such special variables, adopt its code and use it in the PHPINCLUDE section of webtemplates. Then webtemplates will be able to use such variables too. But this feature is not for novice because it will involve coding.

glo
08-08-2003, 08:57 AM
thanks Logician,

I am a novice at the moment, but am eager to learn!

T3MEDIA
03-13-2005, 11:02 PM
Looking for a template that shows 5 random users in a nice little neat box.
this is for my bigger template that will have a new member find.
I have it almost done. acutally it IS done. this additon is needed.
so in other words

:smoke: :pirate: :lick: :devious: :speechless:
it would look like that but that would be random users THAT have avatars or profile pictures. whichever is easier.

Icehawk002
10-03-2005, 10:58 AM
Wonder if anyone can help I am trying to position two IFRAMES side by side within a webtemplate using the code below (sorry not a coder barely computer literate somedays) the code below correctly places the first IFRAME but the second is pushed to the bottom of the page. ??????


<!-- INLINE FRAME -->
<TABLE cellpadding="0" cellspacing="0" border="0" class="iframe"><tr><td>
<IFRAME height="520" name="soundframe" src="window-welcome.htm" width="200" style="position:relative; left:10px; frameborder=0 scrolling="yes"></IFRAME>
</td></tr></table>
<!-- INLINE FRAME -->
<DIV>
<!-- INLINE FRAME -->
<TABLE cellpadding="0" cellspacing="0" border="0" class="iframe"><tr><td>
<IFRAME height="330" name="soundframe" src="../Library/wa2.htm" width="520" style="position:absolute; right:45px; frameborder=2 scrolling="yes"></IFRAME>
</td></tr></table>
<!-- INLINE FRAME -->

Thanks in advance

Logician
10-03-2005, 05:10 PM
Wonder if anyone can help I am trying to position two IFRAMES side by side within a webtemplate using the code below (sorry not a coder barely computer literate somedays) the code below correctly places the first IFRAME but the second is pushed to the bottom of the page. ??????

This is really not related to webtemplates, as it is a pure HTML question but here you go:


<!-- INLINE FRAME -->
<TABLE cellpadding="0" cellspacing="0" border="0" class="iframe">
<tr>
<td valign="top"> <IFRAME height="520" name="soundframe" src="window-welcome.htm" width="200" style="position:relative; left:10px; frameborder=0 scrolling="yes"></IFRAME>
</td>
<td valign="top"> <IFRAME height="330" name="soundframe" src="../Library/wa2.htm" width="520" style="position:absolute; right:45px; frameborder=2 scrolling="yes"></IFRAME>
</td>
</tr></table>
<!-- INLINE FRAME -->

Icehawk002
10-03-2005, 07:58 PM
Apologies your right it was a HTML question, however thank you it has helped me complete my webtemplate and I am sure others might benefit so thanks.

Icehawk002
10-14-2005, 05:45 PM
I have a dropdown menu in the default template, when dropped this becomes obscured (goes behind) the Iframe above in the body of the template. Any suggestions how I get it to go infront.

probably another html question but might be related to the webtemplates which is why I ask here.

ps this web templates mod is super.

leitel
02-13-2006, 07:50 PM
I am building a directory that will connect to vb user table. I am wondering if I can somehow pass a parameter to the webquery to bring up a particular record by pre-setting a variable in your Query PHPInclude Code (Before) section.

For example:

Query:
SELECT name FROM people WHERE id = $nameid ORDER BY name DESC LIMIT 1

PHPInclude:
$nameid = a value i pull off of the address string


I need to dust off my debugger to see what values exist at this point in the runtime. But can someone give me the syntax to pull a parameter value from the URL?
www.noblood.org/forum/view.php?pg=test2&nameid=9999

Thanks! :)

I just tried:

Query:
SELECT name FROM people WHERE id = $nameid ORDER BY name DESC LIMIT 1

PHPInclude:
$nameid = 4

$nameid did not resolve. :( So I take it that the query can not contain php variables?

Logician
02-14-2006, 07:24 AM
I am building a directory that will connect to vb user table. I am wondering if I can somehow pass a parameter to the webquery to bring up a particular record by pre-setting a variable in your Query PHPInclude Code (Before) section.

For example:

Query:
SELECT name FROM people WHERE id = $nameid ORDER BY name DESC LIMIT 1

PHPInclude:
$nameid = a value i pull off of the address string


I need to dust off my debugger to see what values exist at this point in the runtime. But can someone give me the syntax to pull a parameter value from the URL?
www.noblood.org/forum/view.php?pg=test2&nameid=9999

Thanks! :)

I just tried:

Query:
SELECT name FROM people WHERE id = $nameid ORDER BY name DESC LIMIT 1

PHPInclude:
$nameid = 4

$nameid did not resolve. :( So I take it that the query can not contain php variables?
What you try to do sounds doable. However how you do it depends on vb version (hence webtemplate version) so it can help to know this.

Also it is a good idea if you paste your webtemplate/webquery (with its exact phpinclude code) so that we can check how you did it.

leitel
02-14-2006, 09:35 AM
Thank you for your responce.

I would like for example to present one record using a WebTemplates page that is based on a single query that receives from the URL the record id.

I am using vB 3.53 and WebTemplates 3.5.x.


Query:
SELECT name FROM people WHERE id = $nameid ORDER BY name DESC LIMIT 1

PHPInclude:
$nameid = a value i pull off of the address string

Example URL:
www.noblood.org/forum/view.php?pg=test&nameid=9999

Logician
02-14-2006, 11:18 AM
Thank you for your responce.

I would like for example to present one record using a WebTemplates page that is based on a single query that receives from the URL the record id.

I am using vB 3.53 and WebTemplates 3.5.x.


Query:
SELECT name FROM people WHERE id = $nameid ORDER BY name DESC LIMIT 1

PHPInclude:
$nameid = a value i pull off of the address string

Example URL:
www.noblood.org/forum/view.php?pg=test&nameid=9999


Use this in phpinclude:

$vbulletin->input->clean_gpc('r', 'nameid', TYPE_INT);
$nameid = $vbulletin->GPC['nameid'];

More info here:
https://vborg.vbsupport.ru/showpost.php?p=862083&postcount=93

silly rabbit
02-24-2006, 01:35 PM
Webtemplates still has a structure for creating such special variables and templates but it is for advanced users only. People who is proficient in PHP can check vbulletin's algorithm for such special variables . . .
Logician, I see your 'share' thread survives!! Am studying / using your WT system and don't have any real problems(yet) but would value your opinion. Do you see any conflicts or problems with integrating WT with Abe's FORMS HACK (https://vborg.vbsupport.ru/showthread.php?t=93970) ??? One is great at DB reading (yours) and the other is suited to DB / thread writing and although I certainly have more research & learning to do I'm will try to combine the two.

Also, I'm trying to migrate away from the 'td' (table data) and FRAMING system and am using Css for both 'style' and layout formatting thru the use of 'href' and 'import'. As far as positioning is concerned Percent works well but 'absolute' is so so . . .

Any gENERAL Thoughts / Tips to Share??

leitel
02-24-2006, 01:47 PM
I also needed a means to manage vb and non-vb data from within vb. I looked at forms hack. It looks adequate for simple needs. I needed more. Then 're-discovered' CodeCharge (http://www.yessoftware.com/products/product_detail.php?product_id=1) . With a little hacking you can embed the code 'within' vb pages!!

Logician
02-24-2006, 01:53 PM
Logician, I see your 'share' thread survives!! Am studying / using your WT system and don't have any real problems(yet) but would value your opinion. Do you see any conflicts or problems with integrating WT with Abe's FORMS HACK (https://vborg.vbsupport.ru/showthread.php?t=93970) ??? One is great at DB reading (yours) and the other is suited to DB / thread writing and although I certainly have more research & learning to do I'm will try to combine the two.

Also, I'm trying to migrate away from the 'td' (table data) and FRAMING system and am using Css for both 'style' and layout formatting thru the use of 'href' and 'import'. As far as positioning is concerned Percent works well but 'absolute' is so so . . .

Any gENERAL Thoughts / Tips to Share??
Sorry I have no idea, I have never used that hack.

silly rabbit
02-24-2006, 08:59 PM
Sorry I have no idea, I have never used that hack.
Then 're-discovered' CodeCharge (http://www.yessoftware.com/products/product_detail.php?product_id=1) . With a little hacking you can embed the code 'within' vb pages!!
Great job nonetheless Logician - will report back 'results'!!

Can I parse in HTML and still embed php????

Oh, never knew href file addressing to be Case Sensitive!!!! ('lil things do drive ya nuts!)[/COLOR][/SIZE]

I see CodeCharge - if it generates pages via 'td' with styling 'inline' it's really not much use to me as I need to develop and control my own HTML within Css. Am currently using Studio5 from UltraEdit.com (costs less) having also tried Zends Studio 5 which is geared more for local server side (not hosts). BOTH support ALL scripting languages including PHP and Css thru easy FTP access.

Css Is Great!!!

Holy Cow, I LIKE the editors 'color' selector!!! (also a hack to investigate?) I'd like to see it in HEX values!!!

Cheers!!

geezmo
04-10-2006, 07:46 AM
Hi! How do I make a webquery that pulls a post posted fromma certain forum and makes it a separate WebTemplate page?

Sort of an article system, where I make a new thread in say Forum 1 and that new thread becomes a new article page in WebTemplate? So that if I made 10 new threads in Forum 1, I can have 10 different WebTemplate pages corresponding to each of those new threads? Also I don't want it to be a simple link to the post in the forum but a stand-alone article itself.

Hmm.. exactly like this: http://www.theadminzone.com/forums/articles.php?do=viewarticle&aid=18141

bada_bing
04-12-2006, 03:22 AM
Lets see more webQueries and your code. This thread would be cool of we can make this a total "post your WebTemplates and WebQueries for others to see and use.

I currently have WebTemplates installed and I know there is tons of potentials with this hack but me not being a coder I would like to get some ideas of how your using this hack and details on how you created it.

Logician
04-12-2006, 07:02 AM
Lets see more webQueries and your code. This thread would be cool of we can make this a total "post your WebTemplates and WebQueries for others to see and use.

I currently have WebTemplates installed and I know there is tons of potentials with this hack but me not being a coder I would like to get some ideas of how your using this hack and details on how you created it.
I agree with you and the goal of this thread was actually this but I'm afraid hack users are not interested in sharing their WT/WQ much. :knockedout:

Actually import/export WT section is only designed so that people can easily share their work but unless they do, there is not much I can do. Unfortunately I don't have time to create new WT/WQ so it would be really great if hack users take the liberty and help eachother. :cool:

bada_bing
04-12-2006, 05:38 PM
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 templatequeryon 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 :

everybody6 Admin

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 ----
everybody6 Admin templatequeryon
<!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???

bada_bing
06-16-2006, 02:49 PM
Any update to this thread? Lets keep it alive and post your code and what you are using this hack for.

Ntfu2
06-16-2006, 03:07 PM
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???


In the config.php there is a place to add your member id number to the users that can run queriers.

Make sure your number is there :)

ChrisBaktis
08-11-2006, 03:03 AM
Any help with the webquery to list the top to referers and how many referals they have?

louis_chypher
08-15-2006, 10:46 AM
Any suggestion on how to pass a parameter to a web querry and have it included in the query? Such as an event id.

such as:

SELECT something FROM calendar where id=xxxx

where I pass to the query the value for xxxx?

Also:

Any help with the webquery to list the top to referers and how many referals they have?


I am assuming by, "to list the top to referers" you mean the top two (2) referers?

Try in your admin Maintainence sql query (see note):

SELECT COUNT(2) AS count, user.userid AS userid
FROM XXXuser AS users
INNER JOIN XXXuser AS user ON(users.referrerid = user.userid)
WHERE users.referrerid <> 0
GROUP BY users.referrerid


*NOTE: replace XXX with the prefix name that you are using for you dB.

The prefix name I use is "vb_" so the query I would use is:

SELECT COUNT(2) AS count, user.userid AS userid
FROM vb_user AS users
INNER JOIN vb_user AS user ON(users.referrerid = user.userid)
WHERE users.referrerid <> 0
GROUP BY users.referrerid

If you do not have a prefix then use:

SELECT COUNT(2) AS count, user.userid AS userid
FROM user AS users
INNER JOIN user AS user ON(users.referrerid = user.userid)
WHERE users.referrerid <> 0
GROUP BY users.referrerid

******************
if that is what you want then the below should work in your web query as the query to get the count and who:

SELECT COUNT(2) AS count, user.userid AS userid
FROM " . TABLE_PREFIX . "user AS users
INNER JOIN " . TABLE_PREFIX . "user AS user ON(users.referrerid = user.userid)
WHERE users.referrerid <> 0
GROUP BY users.referrerid

Logician
08-16-2006, 09:49 PM
Any suggestion on how to pass a parameter to a web querry and have it included in the query? Such as an event id.

such as:

SELECT something FROM calendar where id=xxxx

where I pass to the query the value for xxxx?

Also:

You can use phpinclude part of webquery. Check priv_privatemessages wt for an example.

louis_chypher
08-18-2006, 11:28 AM
Hopefully, I can explian this correctly.

Lets say I made a WebTemplate that is a 'template'; lets call it TemplateTemplate.

I would like to create a webtemplate page (to keep it simple) that allows for the entry of a name and submit button. When a name has been entered and the submit button is pressed the TemplateTemplate is used as a template to create a brand new web template that is named based upon the entred name.

Another try at an explination

I have a webtemplate named TemplateTemplate that is the base template to create other templates off of.

I have another web template that a user can go to, call it 'CreateTemplate'. CreateTemplate has a text field and a submit button. When the submit button is pressed on CreateTemplate, create template (calling what ever is needed) takes TemplateTemplate as a base to create a new web template that is named as was entered on CreateTemplate.

Is this possible?

What code or functions do I need to call to make a webtemplate from one web template?
Can there be be 'default settings' or a default template used to create other templates from?

If its not possilble then what would be needed to make it possible?

grazianno
09-20-2006, 12:32 PM
hi,
i want use the recent attachment code with webtemplates to display the recent attachments

the recent attachment code is:


<------the code to add in index.php------>
$trix = $db->query("
SELECT attachmentid, dateline, filename
FROM attachment
WHERE dateline < " . TIME() ."
ORDER BY dateline DESC
LIMIT 5");

while ($recentattachment = $db->fetch_array($trix))
{
eval('$latestattachments .= "' . fetch_template('recent_attachments') . '";');
}
<------/the code to add in index.php------>

<------the code to add in a new template "recent_attachments"------>
<tr>
<td class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" valign="top">
<td>
<tr>
<td width="30%"><a href="attachment.php? attachmentid=$recentattachment[attachmentid]">
<img src='attachment.php? attachmentid=$recentattachment[attachmentid]' alt='$recentattachment[filename]' width="50" height="50">
</a>
<br> Attachment number $recentattachment[attachmentid]
</td>

</tr></td>
</td>
</tr>
</table>
<------/the code to add in a new template "recent_attachments"------>

<------the code to add in the forumhome template ------>
<table class="tcat" cellpadding="0" cellspacing="0" border="0" width="100%" align="center" valign="top">
<tr>
<td class="thead" width="100%">
<normalfont><b>Recent ATTachment</b></normalfont></td></tr>
<tr>
<td align="center">
$latestattachments
</td>
</tr>
</table>
<------/the code to add in the forumhome template ------>


i dont know where to add this code
while ($recentattachment = $db->fetch_array($trix))
{
eval('$latestattachments .= "' . fetch_template('recent_attachments') . '";');
}

if someone can help...
thx