PDA

View Full Version : how can I do this?


mam14
07-06-2001, 08:21 AM
I always found the multi-page style of vB where page numbers are displayed at the bottom of the page, rather boring..
So I thought about modifying it & I came across a site running a forign language bb with a somewhat cool way of displaying the pages. Here is a snapshot of it..

Also note that whenever a page is accessed, that cell is highlighted in the table.

Questions is: how can modify vB 2.0.1 so that it looks more like this..
Any Ideas?

Guarddog
07-06-2001, 11:20 AM
Just create a for loop... :)

mam14
07-06-2001, 04:05 PM
Thanks for the input Guarddog.. but I have no idea what you're talking about!

Guarddog
07-07-2001, 10:28 AM
I don't use VBulletin, don't have the code, but i've got an idea.


$normalc = ""; #Normal color
$highlightc = "red"; #The highlighted bar color


$output = "<table>\n";
for($pageloop=1;$pageloop<$totalpages;$pageloop++){
if($pageloop == $currentpage)
$output .= "<tr><td bgcolor=\"$highlightc\">$pageloop</td></tr>";
else
$output .= "<tr><td bgcolor=\"$normalc\">$pageloop</td></tr>";
}

$output .= "</table>";
echo $output;


I don't know if i used the right intergers, it may be like arrays or something: $vars["currentpage"];, i don't know cause i don't have the code...

Rare
07-20-2001, 06:30 PM
Can someone hack this?

NanoEntity
07-21-2001, 03:27 PM
wow cool, can someone create this hack, looks pritty!

NanoEntity
07-27-2001, 06:47 AM
BUMP^

Pie'oh'pah
07-27-2001, 08:38 AM
Agreed. Somebody hack this !! :D

ThomasP
07-27-2001, 09:03 AM
looks awesome! thumbs up

bad_madman
07-27-2001, 04:38 PM
(screenshot below) / vB 2.01

1. create new template called numbernav_own
$firstpage_atag$doublearr1$endfirstprevtag $prevpage_atag$singlearr1$endfirstprevtag $pagenumbers $nextpage_atag$singlearr2$endlastnexttag $lastpage_atag$doublearr2$endlastnexttag
2. create new template called numbernav_pages_own (the content beginning and ending with a blank)
$numbernav_atag$curpage$endpagetag

3. edit FORUMDISPLAY.PHP

find:
$shorturl="forumdisplay.php3?s=$session[sessionhash]&forumid=$forumid&daysprune=$daysprune&sortorder=$sortorder&sortfield=$sortfield&perpage=$perpage";
add below:
$doublearr1='«';$doublearr2='»';$singlearr1='‹';$s inglearr2='›';

find:
$prevpage_atag='';
add below:
$doublearr1='';
$singlearr1='';

find:
$firstpage_atag="<a href=\"$shorturl&pagenumber=1\">";
replace with:
$firstpage_atag="<a class=\"pageNum\" href=\"$shorturl&pagenumber=1\">";

find:
$prevpage_atag="<a href=\"$shorturl&pagenumber=".($pagenumber-1)."\">";
replace with:
$prevpage_atag="<a class=\"pageNum\" href=\"$shorturl&pagenumber=".($pagenumber-1)."\">";

find:
$nextpage_atag='';
add below:
$doublearr2='';
$singlearr2='';

find:
$lastpage_atag="<a href=\"$shorturl&pagenumber=$totalpages\">";
replace with:
$lastpage_atag="<a class=\"pageNum\" href=\"$shorturl&pagenumber=$totalpages\">";

find:
$nextpage_atag="<a href=\"$shorturl&pagenumber=".($pagenumber+1)."\">";
replace with:
$nextpage_atag="<a class=\"pageNum\" href=\"$shorturl&pagenumber=".($pagenumber+1)."\">";

find:
$numbernav_atag="";
replace with:
$numbernav_atag='<span class="pageNum">';

find:
$endpagetag = '';
replace with:
$endpagetag = '</span>';

find:
eval("\$pagenumbers .= \"".gettemplate('numbernav_pages')."\";");
replace with:
eval("\$pagenumbers .= \"".gettemplate('numbernav_pages_own')."\";");

find:
$numbernav_atag="<a href=\"$shorturl&pagenumber=$curpage\">";
replace with:
$numbernav_atag="<a class=\"pageNum\" href=\"$shorturl&pagenumber=$curpage\">";

find:
eval("\$pagenumbers .= \"".gettemplate('numbernav_pages')."\";");
replace with:
eval("\$pagenumbers .= \"".gettemplate('numbernav_pages_own')."\";");

find:
eval("\$pagenav = \"".gettemplate('numbernav')."\";");
replace with:
eval("\$pagenav = \"".gettemplate('numbernav_own')."\";");

and last:
add in headinclude template in the Style Sheets section ( <style type="text/css"> ):
.pageNum {color: #ffffff; background-color: #808080; border-color: #000000; border-style: solid; border-width: 1px; margin: 0px; padding: 0px; padding-left: 4px; padding-right: 4px; width: 1em;}
a.pageNum {color: #0000ff; background-color: #e0e0e0;}
a.pageNum:hover {color: #ffffff; background-color: #a0a0a0;}

cu
Madman

Pie'oh'pah
07-27-2001, 07:20 PM
Lo mate,

first thanx for doin this!!

Unfortunately, it doesn't work for me.

I did as you said

(execpt, that 2 lines $prevpage_atag=""; and $nextpage_atag=""; have been different in my file, they used ' ' instead of " " )

Everything else went fine, changed/added the templates, but it still looks same as before

Im using IE 6....

Any hints?

bad_madman
07-27-2001, 08:24 PM
The Style Sheets are correct (http://www.unreal-alliance.de/vbulletin/), but who are the forums with more than 25 threads (standard in vB) per page.

Note: the modifications affect only the forum (all pages, which are called by forumdisplay.php display).

MSIE6: Is all the same. I tested also the MSIE 6.0.

Otherwise does not know however, what it could still be :(
Sorry for my bad english

Madman

Pie'oh'pah
07-27-2001, 09:34 PM
On our Board 10 threads per page is standard before splitting over multiple pages.

Take a look at this thread for example, its more then 70 replies:

http://www.unreal-alliance.de/vbulletin/showthread.php3?s=&threadid=509&pagenumber=1

it should affect it, or am i mistaken?

Take a look to the picture.

This is, what i want to get rid of :D

bad_madman
07-27-2001, 10:07 PM
[QUOTE]Note: the modifications affect only the forum (all pages, which are called by forumdisplay.php display) :D

Pie'oh'pah
07-27-2001, 10:54 PM
Do'h :D

well, we are getting closer

<switching to german language>

Ich habe wahrscheinlich einen irgendwo einen Fehler gemacht, kann ihn aber nicht finden.

Schau doch mal auf die site, vielleicht kannst du mir eben einen tip geben, wo ich suchen muss.

Es sieht so aus, als ob etwas bei dem code f?r die aktuelle Seite und beim code f?r den Sprung zur letzten Seite nicht stimmt

bad_madman
07-27-2001, 11:26 PM
:D cool :D

forgotten this line to replace ?

--------------------------------------------------------------------------------
$endpagetag = '';
--------------------------------------------------------------------------------

with:

--------------------------------------------------------------------------------
$endpagetag = '</span>';
--------------------------------------------------------------------------------

btw - good german ;)
Madman

bad_madman
07-27-2001, 11:40 PM
Sorry, there an error was in my entry. My entry was not displayed correctly in this Forum (probably by the vB code PHP). The error concerns the 2 templates - you must modify those again. I have mean entry in the forum corrected (vB-Code PHP removed).

Madman

Pie'oh'pah
07-27-2001, 11:47 PM
Originally posted by Bad_Madman
btw - good german ;)
Madman

LOL probably because I am german :D:D:D

<switching again>

Nee, den </span> hatte ich nich vergessen. war drin.
Was deine letzte message angeht, schreib mir das doch nochmal auf deutsch.

oder sonst ICQ 13422324 (ich bin invisible)

Bin noch wach (2:38)

bad_madman
07-27-2001, 11:53 PM
ich fasse es nicht - ein Deutscher. Mein Gott, mein english ist ja sooo mies - wieso l?sst Du mich erst ewig mit meinem english abk?mpfen :D

Also auf Deutsch:
Bei den Eintragungen, die in den 2 Templates vorgenommen werden m?ssen hat sich im Forum ein Fehler eingeschlichen. Ich hatte es richtig gepostet, aber nach dem Abspeichern fehlten Eintr?ge - auch nach dem erneuten Editieren meines Eintrags waren Sie da (im Edit-Fenster), aber nach dem Speichern fehlten sie wieder :(

Deswegen habe ich die Eintragungen, die in den Templates vorgenommen werden m?ssen ohne den vB-Code 'PHP' dargestellt. Dann ist es korrekt. Das war auch der Fehler bei Dir (dass zwischendurch ein $ angezeigt wurde und dass ein </span> bei Dir fehlte.

Jetzt sollte es funktionieren :D

cu
Madman

Pie'oh'pah
07-28-2001, 12:49 AM
Thnx :D:D:D

It's working perfectly now! Great job.

PS: Schlaf jut :)

mam14
07-28-2001, 07:37 AM
can someone wrap this up and create a good English language instruction file??

Thanks for the great work!

mam14
07-28-2001, 09:25 AM
Thanks Bad_Madman..
But I did exactly what you said and nothing changed! The thread pages are still exactly the same as before.. Is there anything else I should do?

Pie'oh'pah
07-28-2001, 11:26 AM
Step 1. (skip if exists)

create new template called numbernav_own

$firstpage_atag$doublearr1$endfirstprevtag $prevpage_atag$singlearr1$endfirstprevtag $pagenumbers $nextpage_atag$singlearr2$endlastnexttag $lastpage_atag$doublearr2$endlastnexttag

create new template called numbernav_pages_own

$numbernav_atag$curpage$endpagetag




Step 2. edit showthread.php

find:
$shorturl="showthread.php3?s=$session[sessionhash]&threadid=$threadid&perpage=$perpage";
add below:
$doublearr1='«';$doublearr2='»';$singlearr1='‹';$s inglearr2='›';


find:
$prevpage_atag='';
add below:
$doublearr1='';
$singlearr1='';


find:
$nextpage_atag='';
add below:
$doublearr2='';
$singlearr2='';


find:
$numbernav_atag="";
replace with:
$numbernav_atag='<span class="pageNum">';


find:
$endpagetag = '';
replace with:
$endpagetag = '</span>';


find:
eval("\$pagenumbers .= \"".gettemplate('numbernav_pages')."\";");
replace with:
eval("\$pagenumbers .= \"".gettemplate('numbernav_pages_own')."\";");


find:
$numbernav_atag="<a href=\"$shorturl&pagenumber=$curpage\">";
replace with:
$numbernav_atag="<a class=\"pageNum\" href=\"$shorturl&pagenumber=$curpage\">";


find:
eval("\$pagenumbers .= \"".gettemplate('numbernav_pages')."\";");
replace with:
eval("\$pagenumbers .= \"".gettemplate('numbernav_pages_own')."\";");


find:
eval("\$pagenav = \"".gettemplate('numbernav')."\";");
replace with:
eval("\$pagenav = \"".gettemplate('numbernav_own')."\";");


Step3. Find and replace all
class=\"thtcolor\"
with:
class=\"pageNum\"




and last:
add in headinclude template in the Style Sheets section ( <style type="text/css"> ):
.pageNum {color: #ffffff; background-color: #808080; border-color: #000000; border-style: solid; border-width: 1px; margin: 0px; padding: 0px; padding-left: 4px; padding-right: 4px; width: 1em;}
a.pageNum {color: #0000ff; background-color: #e0e0e0;}
a.pageNum:hover {color: #ffffff; background-color: #a0a0a0;}


That should do it. Thanx again to Madman!

mam14
07-28-2001, 02:12 PM
This is great guys.. I got it working..
One thing.. Pie'oh'pah..why is the hover function much slower in the forumdisplay?

Pie'oh'pah
07-28-2001, 02:51 PM
Dude,

i haven't done this hack! Therefore I won't take credit :D

If you would have provided a link to your board, I could have checked though.

If you took a look at my site (unreal-alliance.de) then its probably because of the shockwave applets running. This slows stuff up...

Anyways, madman needs to take a look. I just followed your request by making the instructions somewhat easier to understand.

-Pie

Remi
07-29-2001, 08:36 PM
" $numbernav_atag$curpage$endpagetag " (without ")

I don't understand what do you mean by (without ")

Can someone clear this please

bad_madman
07-29-2001, 08:52 PM
[QUOTE]Originally posted by Remi
" $numbernav_atag$curpage$endpagetag " (without ")

I don't understand what do you mean by (without ")

Can someone clear this please

Remi
07-29-2001, 08:58 PM
Thanks :D