how to remove number of replies

Is message board greying out your hair (at least what's left of it)? Let us help you here
Locked
icepack
Posts: 70
Joined: Mon Oct 15, 2007 1:38 pm

how to remove number of replies

Post by icepack »

Script URL:
Version of script:
Hosting company:
URL of phpinfo.php:
URL of session_test.php:
What terms did you try when SEARCHING for a solution:

Write your message below:

I've noticed that after the name of the poster and the date there is a (x) where x is the number of replies. just wondering which part of the code i edit to remove that.
also just wondering if it was possible to move someone's post.
btw the license removal is great, so simple!! thanks klemen
Klemen
Site Admin
Posts: 10116
Joined: Fri Feb 11, 2005 4:04 pm

Post by Klemen »

Hmm, try this:

1. BACKUP ALL FILES, including threads.txt!
2. In threads.txt remove brackets (and the number within) all lines starting with

Code: Select all

<!--o
. For example change

Code: Select all

<!--o 1--> (3)
to just

Code: Select all

<!--o 1-->
3. in mboard.php change

Code: Select all

"<!--o $count--> (0)\n"
to

Code: Select all

"<!--o $count-->\n"
twice within the code.
4. in mboard.php find

Code: Select all

    if (!empty($up) && strstr($mythread,'<!--o '.$up.'-->'))
    {
        preg_match("/<\!--(.*)-->\s\((.*)\)/",$mythread,$matches);
        $number_of_replies=$matches[2];$number_of_replies--;
        $newthreads.= '<!--o '.$up.'--> ('.$number_of_replies.")\n";
        continue;
    }
    elseif (strstr($mythread,'<!--z '.$num.'-->')) {$keep = 'NO'; continue;}
and change it to

Code: Select all

if (strstr($mythread,'<!--z '.$num.'-->')) {$keep = 'NO'; continue;}
4. in mboard.php find

Code: Select all

        preg_match("/<\!--(.*)-->\s\((.*)\)/",$threads[$i],$matches);
        $number_of_replies=$matches[2];$number_of_replies++;
        $threads[$i] = "<!--o $orig_id--> ($number_of_replies)\n";
and change it to

Code: Select all

$threads[$i] = "<!--o $orig_id-->\n";
I haven't tested any of this though.

As for moving posts - no easy way of doing it, you'd have to edit threads.txt manually. Each post starts with <!--z NUMBER--> and ends with <!--k NUMBER-->. Replies are located between <!--o NUMBER--> and <!--k NUMBER-->. You need to keep track of all the <ul>, <li> and <p>'s and close them properly. If you wish more help here you will have to try and see. I suggest upload a test verison somewhere, post a few posts to see how the threads.txt changes. When you get the hang of it try moving a few posts (NUMBERs don't really matter, just that the architecture is correct).
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
icepack
Posts: 70
Joined: Mon Oct 15, 2007 1:38 pm

Post by icepack »

tested and wrking
thanks a lt!
Locked