PDA

View Full Version : Number of views in forumdisplay to show as graphics...



MarkB
Thu 4th Oct '01, 4:36am
Hiyis :)

Is it possible to have number of threadviews on the forum pages displayed as, say, stars instead of numbers? So, basically, to not show the number of views but to instead have an image to indicate its 'popularity'?

What templates would I need to change for this (or would it be a file hack?)?

Thanks!:)
Mark

Chen
Thu 4th Oct '01, 4:45am
Yes it's possible, but I wouldn't say stars is the best way.

Any way, you will need to hack forumdisplay.php.
You will need to add something like this:

if ($thread[views]<100) {
$thread[views]="<img src=\"{imagesfolder}/image1.gif\">";
} elseif ($thread[views]<200) {
$thread[views]="<img src=\"{imagesfolder}/image2.gif\">";
} elseif ($thread[views]<300) {
$thread[views]="<img src=\"{imagesfolder}/image3.gif\">";
} elseif ($thread[views]<400) {
$thread[views]="<img src=\"{imagesfolder}/image4.gif\">";
} elseif ($thread[views]<500) {
$thread[views]="<img src=\"{imagesfolder}/image5.gif\">";
} elseif ($thread[views]<600) {
$thread[views]="<img src=\"{imagesfolder}/image6.gif\">";
} elseif ($thread[views]<700) {
$thread[views]="<img src=\"{imagesfolder}/image7.gif\">";
} elseif ($thread[views]<800) {
$thread[views]="<img src=\"{imagesfolder}/image8.gif\">";
} elseif ($thread[views]<900) {
$thread[views]="<img src=\"{imagesfolder}/image9.gif\">";
} else {
$thread[views]="<img src=\"{imagesfolder}/image10.gif\">";
}
right after this:

if ($thread[sticky] == 1) {
$thread[typeprefix]=$stickythreadprefix.$thread[typeprefix];
}

That's the basic idea, you will need to modify it a bit to your needs.

MarkB
Thu 4th Oct '01, 5:50am
Champion! :)

And yeah, stars won't work, but I needed an example :)

Thanks as always!

Mark