Register Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools
  #1  
Old 20 Dec 2007, 02:18
LiLSnooP LiLSnooP is offline
 
Join Date: May 2007
hide some part of code in header template FORUMHOME

hi

i would like to placed some html code
in header template

but also i wish to do in such way that it doesn't appear only in forumhome template

its possible ?


maybe it need to use something like that

<if condition="in_array($show['forumhome'])">

BLABLABLA

</if>

its correct ?

please help me ....
thank you
Reply With Quote
  #2  
Old 20 Dec 2007, 11:26
Triky's Avatar
Triky Triky is offline
 
Join Date: Mar 2007
Location: [Italy]
Do you want it displayed only in your ForumHome page? If yes, this is your code:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

__________________
I'm italian, I am learning english.. so, please, if you see any errors in my grammar or spelling, let me know via PM. Danke!
Reply With Quote
  #3  
Old 20 Dec 2007, 13:23
LiLSnooP LiLSnooP is offline
 
Join Date: May 2007
what do you mean by
THIS_SCRIPT ???
Reply With Quote
  #4  
Old 20 Dec 2007, 13:56
Opserty Opserty is offline
 
Join Date: Apr 2007
Just copy the code he gave and try it :P

If you really want to know, its a PHP constant which set by vB for most scripts so you can compare it to a set value to identify the script. (You don't need to edit anything within the double quotes, just edit between the opening and closing if conditionals.)
Reply With Quote
  #5  
Old 20 Dec 2007, 14:24
LiLSnooP LiLSnooP is offline
 
Join Date: May 2007
okej
but how to do it vice versa

show code on all pages besides index

?

in_array it solve the problem ?
Reply With Quote
  #6  
Old 20 Dec 2007, 16:19
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Real name: Lynne
Originally Posted by LiLSnooP View Post
okej
but how to do it vice versa

show code on all pages besides index

?

in_array it solve the problem ?
Either:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Or

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

I think that should do it. (I used "<>", but I seem to recall someone saying that we should use "!=" instead, or it was vice versa. Can someone comment on that and why?)
Reply With Quote
  #7  
Old 20 Dec 2007, 16:41
Triky's Avatar
Triky Triky is offline
 
Join Date: Mar 2007
Location: [Italy]
Originally Posted by Lynne View Post
(I used "<>", but I seem to recall someone saying that we should use "!=" instead, or it was vice versa. Can someone comment on that and why?)
I've always seen "!=". I don't know why.
__________________
I'm italian, I am learning english.. so, please, if you see any errors in my grammar or spelling, let me know via PM. Danke!
Reply With Quote
  #8  
Old 20 Dec 2007, 17:26
Kirk Y's Avatar
Kirk Y Kirk Y is offline
 
Join Date: Apr 2005
Originally Posted by Triky View Post
I've always seen "!=". I don't know why.
Because != is for negative comparison; doesn't equal.
__________________
Former vBulletin.org Staff Member

Please feel free to re-use any of the code in any of my projects submitted to vB.org, so long as original attribution is retained.
Reply With Quote
  #9  
Old 20 Dec 2007, 18:13
Triky's Avatar
Triky Triky is offline
 
Join Date: Mar 2007
Location: [Italy]
And what does <> stand for?
__________________
I'm italian, I am learning english.. so, please, if you see any errors in my grammar or spelling, let me know via PM. Danke!
Reply With Quote
  #10  
Old 20 Dec 2007, 21:54
Kirk Y's Avatar
Kirk Y Kirk Y is offline
 
Join Date: Apr 2005
I've never seen that operator... and I don't see how it could logically exist. It'd be "is greater than and less than" - which isn't possible.
__________________
Former vBulletin.org Staff Member

Please feel free to re-use any of the code in any of my projects submitted to vB.org, so long as original attribution is retained.
Reply With Quote
  #11  
Old 21 Dec 2007, 01:29
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Real name: Lynne
Originally Posted by Kirk Y View Post
I've never seen that operator... and I don't see how it could logically exist. It'd be "is greater than and less than" - which isn't possible.
It's valid. This is from the php manual:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Reply With Quote
  #12  
Old 21 Dec 2007, 02:24
Kirk Y's Avatar
Kirk Y Kirk Y is offline
 
Join Date: Apr 2005
I suppose that makes sense, if x is less than and greater than y, it'd thus not be equivalent.
__________________
Former vBulletin.org Staff Member

Please feel free to re-use any of the code in any of my projects submitted to vB.org, so long as original attribution is retained.
Reply With Quote
  #13  
Old 16 Jan 2008, 11:54
loonytune15's Avatar
loonytune15 loonytune15 is offline
 
Join Date: Mar 2003

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

I used this and it works great.
I am running a sidebar and have a navigation module in it. When I am on other pages I have a button show up in the header with it all in.
__________________
Website -
Reply With Quote
  #14  
Old 16 Jan 2008, 12:04
Dismounted's Avatar
Dismounted Dismounted is offline
 
Join Date: Jun 2005
Real name: Hanson
Originally Posted by Lynne View Post
It's valid. This is from the php manual:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.
"!=" and "<>" are aliases. They both mean "not equal". Most people use "!=" when programming in PHP because the operator is somewhat easier to understand. "!" in PHP means "not", so it's logical to use it with the equal operator to form "not equal".

In SQL, most people use "<>", as it is standard SQL. The "!=" operator only exists in certain versions of SQL.
__________________
Former vBulletin.org Staff Member

View My Modifications
29 Releases and Counting... Latest Modification: dmActivityStream - vBookie Integration (4.x)

Please do not PM me to ask for support - please use the relevant thread or forum.
Reply With Quote
  #15  
Old 19 May 2010, 11:14
USAMustangs.com USAMustangs.com is offline
 
Join Date: Mar 2007
OK. Question....

How can you exclude a particular template call when you refresh you main forum index.php?

In debugging mode, I have a vbgarage template "vbgarage_latestbits" that is causing me all kinds of problems. It takes 4 - 6 second on average to process because it runs a db query that is calling for SELECT * FROM vbgarage_images ORDER BY RAND() LIMIT 5. There are 533 rows, so this is slowing my site down severely and causing an occasional database error because my host is killing the process for excessive CPU usage. Well, since I can't find "ORDER BY RAND() LIMIT 5" in any of my garage templates or vbgarage.php file. Can I use code similar to what was posted above to remove that template call every time I refresh my main forum index.php? It doesn't come up in my CMPS index.php and the page generates in about 1 second.

If not, is there a workaround where I can run execute a SQL query to change that RAND() or something I can do to the table itself in phpmyadmin?

This is the error I get whenever server loads are high.

Invalid SQL:
SELECT * FROM vbgarage_images ORDER BY RAND() LIMIT 5;

MySQL Error : Server shutdown in progress
Error Number : 1053
Date : Tuesday, May 18th 2010 @ 12:03:03 PM
Script : http://www.usamustangs.com/forum/index.php
Referrer : http://www.usamustangs.com/forum/private.php?folderid=0
IP Address : 71.xxx.xxx.xx
Username : Me
Classname : vB_Database



This is becoming an annoying problem for me. Any help would greatly appreciated. I already attempted to contact the coder to no avail. However, this thread made me wonder if there is a work around. Because I have dedicated link to it on my Navbar. I have no idea why this is running the RAND() query when I don't have the images displaying on my FORUMHOME or Navbar templates.

Thanks.
__________________
vBulletin 3.6.5
My forum
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

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


New To Site? Need Help?

All times are GMT. The time now is 07:33.

Layout Options | Width: Wide Color: