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

Reply
 
Thread Tools Display Modes
  #81  
Old 07-26-2002, 05:30 PM
mbaskett mbaskett is offline
 
Join Date: Jan 2002
Posts: 43
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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

PHP Code:
// ###################### 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") 
Reply With Quote
  #82  
Old 07-29-2002, 07:07 AM
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 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..

Quote:
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?
Reply With Quote
  #83  
Old 07-30-2002, 07:57 PM
mbaskett mbaskett is offline
 
Join Date: Jan 2002
Posts: 43
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
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


Quote:
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.
Reply With Quote
  #84  
Old 07-30-2002, 08:05 PM
Rose's Avatar
Rose Rose is offline
 
Join Date: Nov 2001
Location: K-Town, Germany
Posts: 619
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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. 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?
Reply With Quote
  #85  
Old 07-30-2002, 08:58 PM
Rose's Avatar
Rose Rose is offline
 
Join Date: Nov 2001
Location: K-Town, Germany
Posts: 619
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Also, on my site I have the "Welcome back, Username" here. For unregistered members/guests - how would I include a login panel for them?
Reply With Quote
  #86  
Old 07-31-2002, 07:42 AM
Logician's Avatar
Logician Logician is offline
 
Join Date: Nov 2001
Location: inside vb code
Posts: 4,449
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Rose,
Quote:
Originally posted by Rose
I just added Wild Thinks query/last ten threads and modified it abit. 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..
Quote:
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

Quote:
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..
Reply With Quote
  #87  
Old 07-31-2002, 02:07 PM
Rose's Avatar
Rose Rose is offline
 
Join Date: Nov 2001
Location: K-Town, Germany
Posts: 619
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thank you, Logician! I've changed the query so that my private forums info stays private.

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*
Reply With Quote
  #88  
Old 07-31-2002, 02:18 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 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:
Reply With Quote
  #89  
Old 07-31-2002, 02:30 PM
Rose's Avatar
Rose Rose is offline
 
Join Date: Nov 2001
Location: K-Town, Germany
Posts: 619
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
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?)

PHP Code:
<!-- Left Column Body Start -->
<
td valign="top" width="200"><table bgcolor="#F6EDCA" cellpadding=5 cellspacing="1"><tr width=100height=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
Reply With Quote
  #90  
Old 07-31-2002, 07:12 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 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)]]
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:21 AM.


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.04616 seconds
  • Memory Usage 2,332KB
  • 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_php
  • (10)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
  • (4)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

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

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