vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.5 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=113)
-   -   WebTemplates 3.5.x: VB Integrated CMS (Content Management System) (https://vborg.vbsupport.ru/showthread.php?t=103076)

Logician 04-04-2006 08:58 PM

Quote:

Originally Posted by blacklancer
i read through, and maybe i missed it, but can this be used as a main page (i.e. index.html)??

i was trying to get vbcode to work on my home page (i was using vbexternal), but it wouldn't work no matter what i did. this works beautifully as i have tested it, but i am curious to see if i could use this as a home page for my forums.

Please check Webtemplate Pre-Installation FAQ: Question 7

blacklancer 04-04-2006 09:30 PM

sorry man! http://www.sclc.net/forum/images/smilies/wall.gif

geezmo 04-05-2006 08:34 AM

Ok, I can't go through all of the previous pages so pardon me if this has already been asked.

How do I make a simple template with the body of the article on the right and Google Adsense (not placed inside a box) on the left and the list of articles below AdSense? Do I need to edit the template? Which template and how to edit it? Or do I need to make a new template? How?

Thanks.

Logician 04-05-2006 09:02 AM

Quote:

Originally Posted by geezmo
Ok, I can't go through all of the previous pages so pardon me if this has already been asked.

How do I make a simple template with the body of the article on the right and Google Adsense (not placed inside a box) on the left and the list of articles below AdSense? Do I need to edit the template? Which template and how to edit it? Or do I need to make a new template? How?

Thanks.

Create a new webtemplate that uses "2 columned theme" as a theme and paste your content into this new webtemplate.

Then edit 2 columned theme and insert your google code inside it.

zlos 04-05-2006 06:07 PM

Quote:

Originally Posted by Logician

Dear Logician

Definitely I cannot find way to make it working. Would you please let me know WHAT shall I put WHERE? I have read your instructions carefully, made some tens of tests and still cannot pass variable to the query.

Regards
Tom

Logician 04-05-2006 08:01 PM

Quote:

Originally Posted by zlos
Dear Logician

Definitely I cannot find way to make it working. Would you please let me know WHAT shall I put WHERE? I have read your instructions carefully, made some tens of tests and still cannot pass variable to the query.

Regards
Tom

I think webtemplate "priv_privatemessages" is a good starter to see how this is used. Its phpinclude field says:

PHP Code:

$pm_number intval($_GET['pm_number']);
if (
$pm_number <= 0
{
$pm_number 30;


First line here is the important one and it tells webtemplates hack to know variable "$pm_number" as the GET value of 'pm_number' which comes through the URL.

So when you use an URL like
http://www.myboard.com/forum/view.php?pg=priv_privatemessages&pm_number=50

the value of $pm_number in the webtemplate will be 50. Then you can use it directly in your webquery just like I did in the webquery named "$WQ_priv_privatemessages".

Hope this clarifies better?

zlos 04-06-2006 08:57 AM

Quote:

Originally Posted by Logician
I think webtemplate "priv_privatemessages" is a good starter to see how this is used. Its phpinclude field says:

PHP Code:

$pm_number intval($_GET['pm_number']);
if (
$pm_number <= 0
{
$pm_number 30;


First line here is the important one and it tells webtemplates hack to know variable "$pm_number" as the GET value of 'pm_number' which comes through the URL.

So when you use an URL like
http://www.myboard.com/forum/view.ph...s&pm_number=50

the value of $pm_number in the webtemplate will be 50. Then you can use it directly in your webquery just like I did in the webquery named "$WQ_priv_privatemessages".

Hope this clarifies better?

It solves the issue :)

I have another question, which came also from

Quote:

Originally Posted by leitel
I am trying to format the output so that ONLY IF there is a 'dept', it will print out.
I tried putting code in the query output area as well as at the main page template.

Code:

$WQfield[name]<br/>
<if condition="$WQfield['dept']">
    $WQfield[dept]<br/>
</if>


Thanks! :)

Or ony way/solution to $WQfield in a query result? Simple SQL does not solve my issued, let me present an example:

PHP Code:

$query "
SELECT category_id, name, parent_id
FROM categories
ORDER BY category_id, parent_id"


This query produces a list of categories & subcategories sorted. But I would like to format each row of the query depending on the result. For example:

PHP Code:

if ($row->parent_id 0//means it is a SUBcategory
{ echo "Subcategory: "; } else { echo "-- "; } 

I see, that there is a post query php code available and hope I can solve it somehow. Idea sharing is of the great help for me :)


BTW: I see in your documentation .doc file, that the is somewhere bigger help file for queries. Where is it exactly? :)

Regards
Tom

Logician 04-06-2006 09:19 AM

Quote:

Originally Posted by zlos
It solves the issue :)

I have another question, which came also from



Or ony way/solution to $WQfield in a query result? Simple SQL does not solve my issued, let me present an example:

PHP Code:

$query "
SELECT category_id, name, parent_id
FROM categories
ORDER BY category_id, parent_id"


This query produces a list of categories & subcategories sorted. But I would like to format each row of the query depending on the result. For example:

PHP Code:

if ($row->parent_id 0//means it is a SUBcategory
{ echo "Subcategory: "; } else { echo "-- "; } 

I see, that there is a post query php code available and hope I can solve it somehow. Idea sharing is of the great help for me :)


BTW: I see in your documentation .doc file, that the is somewhere bigger help file for queries. Where is it exactly? :)

Regards
Tom

Sorry you can't do this one with webtemplates because "webquery phpinclude after" section is evaluated after all webquery data is processed, not in the middle of the compilation.

So all you can do is to use such a query:

PHP Code:

$query "
SELECT category_id, name, parent_id
FROM categories
where parent_id > 0
ORDER BY category_id, parent_id"


if this is not good enough, you need to code a custom script for your goal.

Clayton 04-06-2006 01:26 PM

my apologies if this comes across as a stupid question, however can you use this with the CMPS installed?

Thanks

C

Logician 04-06-2006 04:45 PM

Quote:

Originally Posted by Clayton
my apologies if this comes across as a stupid question, however can you use this with the CMPS installed?

CMPS is your site home page, webtemplates are your other vb powered pages. They can get along together.


All times are GMT. The time now is 03:26 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01938 seconds
  • Memory Usage 1,765KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code_printable
  • (7)bbcode_php_printable
  • (8)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (3)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete