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)

rootnik 02-25-2006 02:01 PM

is there a way to count the number or rows returned in a webquery?

Edit: I figured out how to do this by adding the following to my Query PHP include code (after) box.

PHP Code:

$num_rows mysql_num_rows($WQfieldDB);
echo 
$num_rows

BUT, I need to be able to call $num_rows from within the template. Any help?

Logician 02-25-2006 08:43 PM

Quote:

Originally Posted by rootnik
is there a way to count the number or rows returned in a webquery?

Edit: I figured out how to do this by adding the following to my Query PHP include code (after) box.

PHP Code:

$num_rows mysql_num_rows($WQfieldDB);
echo 
$num_rows

BUT, I need to be able to call $num_rows from within the template. Any help?

SELECT count(*) as mycount FROM " . TABLE_PREFIX . "user

$WQfield[mycount]

rootnik 02-27-2006 02:17 PM

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! :)

I'm also wanting to do something similar, but can not figure out how. Is it possible?

bashy 02-28-2006 08:26 PM

Hi peeps

I am trying to make a new page with this script (below)
It does not show how i want it to

Basically what it does is pulls a specified search criteria off
eBay and lists it on a on a page as you can see the script is
php and i thought it might have just been a case of cut and
pasting it into a new template, evidently not as it dont pull
the search criteria.....

Anyway please try yourselves and see what i mean and see if
there is a work around for me :)

PHP Code:

<?php
### Feel free to edit suitable values the first two values are very important
// tracking id is your ebay given id for affiliates
$TrackingID '*****'// ***** REQUIRED
// SID is for Commision Junction tracking and given to you by cj.com
$SID "******"// extra tracking

$TrackingProvider "1"// Either 0=No Affiliate, 1=Commission Junction, 5=Mediaplex
$DefaultItems "NTL"// Front Page items to display by default

### OTHER INFORMATION TO CHANGE (If Required)
$TableHeaderColour "D5E1F5"// results table header color
$TableBorderColour "003399"// Table Border Colour
$ResultsFontColour "000000"// Results Font Colour
$FontType "2"// 0=Arial, 2=Times New Roman, 3=Verdana, 
$LogoType "5"// What eBay Logo to Display
$ResultsPerPage '50'// number of listings to show
$EndingTimeColour "FF0000";
$TableWidth "750"// Width of eBay Table Results

### YES / NO
$SearchDescriptions "n"// search title and description y or n
$ShowImages "y"// Display thumbnails
$ShowEndTime "y"// auction end times
$ShowBidNumbers "y"// number of bids
$PopUp "y"// links open in a new window when this set to yes
$PayPal "y"// paypal logo appears when available

### COUNTRY LOCATION SECTION ** See Installion/Help Guide for Country Codes
$LocationSiteID "3"//
### END CONFIGURATION

$item $_GET['item'];
if (!
$item) {$item ="$DefaultItems";}
   
?> 
<HTML>
<HEAD>
<TITLE><?php echo $item?> from the eBay auction place.</TITLE>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</HEAD>

<BODY> 

<table width="<?php print "$TableWidth"?>" border="0" align="left" cellpadding="4" cellspacing="1" bgcolor="<?php print "$TableBorderColour"?>"> 
<tr> 
<td align="center" valign="top" bgcolor="<?php print "$TableHeaderColour"?>">  
<div align="center"> 
<form method="get"> 
<p align="left"> 
<input name="item" type="text" value="<?php echo $item?>" size="35" maxlength="100"> 
<input type="submit" name="Submit" value="Search eBay"> 
<br>
<font face="Verdana" size="2">
<A HREF="http://www.qksrv.net/click-<?php print "$TrackingID"?>-5463217?loc=http%3A//cgi4.ebay.co.uk/aw-cgi/eBayISAPI.dll%3FRegisterShow%26ssPageName%3Dh%3Ah%3Areg%3AUS" target="_blank">
<B><font color="#000080">Register with eBay</font></B></A></font></p>
</form> 
</div></td> 
</tr> 
</table> 
<p><br>
<br>
<br>
&nbsp;</p>
<table border="0" align="left" cellpadding="4" cellspacing="1"> 
<tr> 
<td align="center"><BR> 
<BR> 
<script language="JavaScript" src="http://ilapi.ebay.com/ws/eBayISAPI.dll?EKServer&amp;ai=s%7di%3a%3d%3a&amp;bdrcolor=<?php print "$TableBorderColour"?>&amp;cid=0&amp;encode=ISO-8859-1&amp;endcolor=<?php print "$EndingTimeColour"?>&amp;endtime=<?php print "$ShowEndTime"?>&amp;fntcolor=<?php print "$ResultsFontColour"?>&amp;fs=<?php print "$FontType"?>&amp;hdrcolor=<?php print "$TableHeaderColour"?>&amp;img=<?php print "$ShowImages"?>&amp;lnkcolor=0000FF&amp;logo=<?php print "$LogoType"?>&amp;num=<?php print "$ResultsPerPage"?>&amp;numbid=<?php print "$ShowBidNumbers"?>&amp;paypal=<?php print "$PayPal"?>&amp;popup=<?php print "$PopUp"?>&amp;prvd=<?php print "$TrackingProvider"?>&amp;query=<?php print "$item"?>&amp;r0=3&amp;shipcost=<?php print "$ShowShipping"?>&amp;sid=<?php print "$SID"?>&amp;siteid=<?php print "$LocationSiteID"?>&amp;sort=MetaEndSort&amp;sortby=<?php print "$SortBy"?>&amp;sortdir=asc&amp;srchdesc=<?php print "$SearchDescriptions"?>&amp;tbgcolor=FFFFFF&amp;tlecolor=FFCE63&amp;tlefs=0&amp;tlfcolor=000000&amp;track=<?php print "$TrackingID"?>&amp;width=<?php print "$TableWidth"?>"></script> 
<BR> </TD> 
</TR> 
</TABLE>
</BODY>
</HTML>


WNxWakko 03-05-2006 04:16 AM

Selecting PHP does not work. I tested it by trying something simple.

I made a new page and only typed in one word in the body portion. Saved it and when I try to view, I get a blank white page. If I toggle it to html, my word shows up on the page.

Logician 03-05-2006 06:39 AM

Quote:

Originally Posted by WNxWakko
Selecting PHP does not work. I tested it by trying something simple.

I made a new page and only typed in one word in the body portion. Saved it and when I try to view, I get a blank white page. If I toggle it to html, my word shows up on the page.

There is a phptest template coming with default installation. Doesn't it work?

WNxWakko 03-05-2006 03:13 PM

I just installed it yesterday. I dont know what default one you are talking about that is php.

Like I said, I did a simple test to see if it worked. I typed TEST in the content window, set it to php and I get nothing. If I set it on text or html my word shows up on the page.

Logician 03-05-2006 03:19 PM

Quote:

Originally Posted by WNxWakko
I just installed it yesterday. I dont know what default one you are talking about.

Like I said, I did a simple test to see if it worked. I typed TEST in the content window, set it to php and I get nothing. If I set it on text or html my word shows up on the page.

Installation STEP 3. Apply it. Then run webtemplate "phptest" and see if it is working.

WNxWakko 03-05-2006 03:27 PM

Ok, installed your samples. Yes that phptest works. But I still dont understand why a fresh new one with nothing more than one word would'nt work.

My homepage is a .php file but its 99% html and then I have some php bits in it to call other information in. So perhaps your php is ment to be purly php with nothing more I dont know.

Logician 03-05-2006 03:34 PM

Quote:

Originally Posted by WNxWakko
Ok, installed your samples. Yes that phptest works. But I still dont understand why a fresh new one with nothing more than one word would'nt work.

My homepage is a .php file but its 99% html and then I have some php bits in it to call other information in. So perhaps your php is ment to be purly php with nothing more I dont know.

Reading user manual really helps: Section 1.3.1.4.3


All times are GMT. The time now is 09:42 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.01933 seconds
  • Memory Usage 1,789KB
  • 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
  • (3)bbcode_php_printable
  • (5)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