Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #131  
Old 08-11-2006, 03:03 AM
ChrisBaktis ChrisBaktis is offline
 
Join Date: Mar 2004
Location: CT
Posts: 409
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Any help with the webquery to list the top to referers and how many referals they have?
Reply With Quote
  #132  
Old 08-15-2006, 10:46 AM
louis_chypher's Avatar
louis_chypher louis_chypher is offline
 
Join Date: Mar 2006
Location: Boise, Idaho
Posts: 130
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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:

Quote:
Originally Posted by ChrisBaktis
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
Reply With Quote
  #133  
Old 08-16-2006, 09:49 PM
Logician's Avatar
Logician Logician is offline
 
Join Date: Nov 2001
Location: inside vb code
Posts: 4,449
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by louis_chypher
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.
Reply With Quote
  #134  
Old 08-18-2006, 11:28 AM
louis_chypher's Avatar
louis_chypher louis_chypher is offline
 
Join Date: Mar 2006
Location: Boise, Idaho
Posts: 130
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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?
Reply With Quote
  #135  
Old 09-20-2006, 12:32 PM
grazianno grazianno is offline
 
Join Date: May 2006
Posts: 28
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

hi,
i want use the recent attachment code with webtemplates to display the recent attachments

the recent attachment code is:

Code:
<------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
Code:
while ($recentattachment = $db->fetch_array($trix))
{
eval('$latestattachments .= "' . fetch_template('recent_attachments') . '";');
}
if someone can help...
thx
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 02:49 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.03732 seconds
  • Memory Usage 2,231KB
  • Queries Executed 12 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (2)bbcode_code
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (5)post_thanks_box
  • (5)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (5)post_thanks_postbit_info
  • (5)postbit
  • (5)postbit_onlinestatus
  • (5)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete