Announcement

Collapse
No announcement yet.

Number of views in forumdisplay to show as graphics...

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Number of views in forumdisplay to show as graphics...

    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

  • #2
    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:
    Code:
          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:
    Code:
          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.
    Chen Avinadav
    Better to remain silent and be thought a fool than to speak out and remove all doubt.

    גם אני מאוכזב מסיקור תחרות לתור מוטור של NRG הרשת ע"י מעריב

    Comment


    • #3
      Champion!

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

      Thanks as always!

      Mark

      Comment

      widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
      Working...
      X