PDA

View Full Version : set specific forum have different button


squawell
06-25-2002, 05:19 AM
as title....

for example like here the full release forum

ahve different buttons like--install button ect.....

how to do that??

Logician
06-25-2002, 07:02 AM
no-hack solution: Create a new style and apply this style to that forum. In that style design your pages in anyway you like.

But if it's only one button you'll change you may regard considering the "hack solution" which is:

put a variable in the template where your button is like $my_button_variable.

Then in the .php file where it calls it, put a line to assign the value to that variable like:

if ($forumid==X) {$my_button_variable='<img scr.........>';}
else {$my_button_variable='<img scr.........>';}

(if ($forumid==X) part may change according to the file you apply this code.)

squawell
06-25-2002, 09:48 AM
Originally posted by Logician
no-hack solution: Create a new style and apply this style to that forum. In that style design your pages in anyway you like.

But if it's only one button you'll change you may regard considering the "hack solution" which is:

put a variable in the template where your button is like $my_button_variable.

Then in the .php file where it calls it, put a line to assign the value to that variable like:

if ($forumid==X) {$my_button_variable='<img scr.........>';}
else {$my_button_variable='<img scr.........>';}

(if ($forumid==X) part may change according to the file you apply this code.)
first thankz Logician reply...

if i want to do "hack solution" which php file should i edit??

showthread or ?? :D

Logician
06-25-2002, 10:25 AM
depends on the location where you want to insert your button. If it's a button like vb.org's INSTALL button which shows up in thread views, yes it's showthread.php that you should edit.

Chris M
06-25-2002, 10:28 AM
Great!

I was looking for this:)

Satan

squawell
06-25-2002, 10:37 AM
Originally posted by Logician
depends on the location where you want to insert your button. If it's a button like vb.org's INSTALL button which shows up in thread views, yes it's showthread.php that you should edit.
thankz ur reply.....:D

but where should i put this code??

and about the variable how do i replace it in showthread template??

replace <img src={XXXXX}......> to the variable(EX:$my_button_variable) is it right?

Logician
06-25-2002, 01:52 PM
put before

// draw nav bar
$navbar=makenavbar($threadid,"thread",0);


And your replacement sample is correct.

squawell
06-25-2002, 08:12 PM
Logician i put the code :PS:there have sapce !!
if ($forumid==X) {$my_button='<img scr={imagesfolder }/XXX.gif>';}
else {$my_button='<img scr={ imagesfolder}/xxx.gif>';}

above

// draw nav bar
$navbar=makenavbar($threadid,"thread",0);


and in showthread template i replace

<a href="newthread.php?s=$session[sessionhash]&action=newthread&forumid=$forum[forumid]"> <img src="https://vborg.vbsupport.ru/images/newthread.gif" border="0" alt="?o???s?峹"></a>


TO


<a href="newthread.php?s=$session[sessionhash]&action=newthread&forumid=$forum[forumid]"> $my_button</a>


and it doesnt work it look like the attachment file......

whats wrong with my code?

Logician
06-25-2002, 08:24 PM
1- do not use { image folder}, enter full path
2- Replace X with your forumid.

squawell
06-26-2002, 08:16 AM
Originally posted by Logician
1- do not use { image folder}, enter full path
2- Replace X with your forumid.

1.full path=<img scr=http://localhost/squawell/images/XXX.gif>

is it right??i test it on my localhost!!

2.i already replace my forumid!!

and Logician the problem still exist!!

i think maybe my first step wrong.........so what is the problem?

Logician
06-26-2002, 09:24 AM
Originally posted by squawell


1.full path=<img scr=http://localhost/squawell/images/XXX.gif>

is it right??i test it on my localhost!!

2.i already replace my forumid!!

and Logician the problem still exist!!

i think maybe my first step wrong.........so what is the problem?
1- put address in double quotes like:
<img scr="http://localhost/squawell/images/XXX.gif">

2- Check if your image path is correct: Call the address http://localhost/squawell/images/XXX.gif from your browser to see if you can see the image. If you cant, find the correct address of the image first and make sure you applied the correct address to the hack code.

3- I dont think there is anything wrong with the hack code. It seems ok. So check your image first..

squawell
06-26-2002, 01:26 PM
Originally posted by Logician

1- put address in double quotes like:
<img scr="http://localhost/squawell/images/XXX.gif">

yes i already check it and its ok.....

2- Check if your image path is correct: Call the address http://localhost/squawell/images/XXX.gif from your browser to see if you can see the image. If you cant, find the correct address of the image first and make sure you applied the correct address to the hack code.

i check it too and it can show up

3- I dont think there is anything wrong with the hack code. It seems ok. So check your image first..

but the problem still here whats the problem u think??

Logician
06-26-2002, 01:34 PM
ok post the HTML code (relevant part only) of the page and lets see..

squawell
06-26-2002, 04:02 PM
if ($forumid==2) {$my_button='<img scr="http://squawellftp.dns2go.com/squawell/images/installed.gif">';}
else {$my_button='<img scr="http://squawellftp.dns2go.com/squawell/images/newthread.gif">';}

// draw nav bar
$navbar=makenavbar($threadid,"thread",0);


the code here....

Logician
06-26-2002, 06:35 PM
no I meant the HTML code of your page not hack code.

Load the page which does not work (the one you took the screenshot) and choose source view in your browser, then post here the code (not all of them, just the section around the image tag we are trying to switch)

BTW. why is your URL "squawellftp.dns2go.com"? Shouldnt you refer to your local host with a line smt. like that:
http://localhost/squawell/images/installed.gif

squawell
06-26-2002, 09:27 PM
Originally posted by Logician
no I meant the HTML code of your page not hack code.

sorry..i misunderstand what u mean.....now i post the file see attachment file....

BTW. why is your URL "squawellftp.dns2go.com"? Shouldnt you refer to your local host with a line smt. like that:
http://localhost/squawell/images/installed.gif
oh...i builded the forum in my localhost...if i want people visit my

forumi must use the url.....if not use the localhost url....

Logician
06-26-2002, 09:38 PM
Originally posted by squawell

oh...i builded the forum in my localhost...if i want people visit my
forumi must use the url.....if not use the localhost url....

And this is your problem..

Here is your source code:

<a href="newthread.php?s=&action=newthread&forumid=2"> <img scr="http://squawellftp.dns2go.com/squawell/images/newthread.gif"></a>

See? the hack produced the code exactly as it should. Your problem is the link to your image is broken. I dont know what's wrong with that URL, but it's certain that it links a orphaned image. Anyway hack is working ok..

squawell
06-27-2002, 12:58 AM
Originally posted by Logician


And this is your problem..

Here is your source code:

<a href="newthread.php?s=&action=newthread&forumid=2"> <img scr="http://squawellftp.dns2go.com/squawell/images/newthread.gif"></a>

See? the hack produced the code exactly as it should. Your problem is the link to your image is broken. I dont know what's wrong with that URL, but it's certain that it links a orphaned image. Anyway hack is working ok..
so the problem is my url link right?

anyway Logician...thnakz for ur help.........

squawell
06-27-2002, 12:58 AM
Originally posted by Logician


And this is your problem..

Here is your source code:

<a href="newthread.php?s=&action=newthread&forumid=2"> <img scr="http://squawellftp.dns2go.com/squawell/images/newthread.gif"></a>

See? the hack produced the code exactly as it should. Your problem is the link to your image is broken. I dont know what's wrong with that URL, but it's certain that it links a orphaned image. Anyway hack is working ok..
so the problem is my url link right?

anyway Logician...thnakz for ur help.........