Re:

##
##
##        Mod title:  Links Page
##
##      Mod version:  1.2
##   Works on PunBB:  1.2.*
##     Release date:  2006-04-06
##           Author:  El Bekko (elbekko@gmail.com)
##
##      Description:  Adds the possibility to have users
##              post links and moderate them from 
##              the admin CP.
##
##   Difference with  
## previous version:  Possibility to have alphabetical Indexing
##              for the links and some small bug fixes.
##
##   Affected files:  Only included files
##                    
##       Affects DB:  Yes (Creates table and adds a value to config)
##
##            Notes:  None
##
##       DISCLAIMER:  Please note that "mods" are not officially supported by
##                    PunBB. Installation of this modification is done at your
##                    own risk. Backup your forum database and any and all
##                    applicable files before proceeding.
##
##

Download

Last edited by elbekko (2006-04-06 15:39:56)

Re:

nice! thanks for the share.

~James
FluxBB - Less is more

Re:

HMM. Any chance of the links being categorized and sorted by subject?

black robe and swill
I believe Anita Hill
judge will rot in hell
it's the song I hate, it's the song I hate

Re:

Installed! Pretty nifty, thank you.

I agree that having the links automatically alphabetized would be waay helpful.

Re:

I thought I ordered them by name... I'll check smile

EDIT: They are indeed ordered by name, but I guess you guys mens something like this:

A
    ? link
    ? link
    ? link
    ? link
    ? link

B
    ? link
    ? link
    ? link

I'll do it smile

Last edited by elbekko (2006-03-13 15:59:15)

Re:

I'll fully release it in a future version, with the option to disable it, but this'll do for now:

Okay, to do it, open Links.php and find this line:

        if($link_num > 0)
            {

ADD AFTER

            // Prevent errors
            $last_a = "";

FIND

            while($link_row = $db->fetch_assoc($link_result))
                {

ADD AFTER

                // START INDEXING
                $firstletter = substr($link_row['LinkName'],0,1);
                
                if($firstletter != $last_a)
                    {
                    echo "</ul>";
                    echo "<b style=\"margin-left:10px\">" . strtoupper($firstletter) . "</b>";
                    echo '<ul style="margin-left:25px">';
                    }
                $last_a = $firstletter;
                // END INDEXING

This should do it just fine smile Have fun smile

Re:

Updated to 1.1, includes the indexing feature with an on/off switch smile

Re:

Sick!

Thank you!!

Re:

The setting in the moderation plugin seems to default to off for indexing, and selecting yes, and saving returns "no" results and can't seem to be changed.

any idea what gives?

Re:

On installation, the default is off. But the changing should work, as I tested it plenty of times locally...

Re:

That's nicer, great thx!

black robe and swill
I believe Anita Hill
judge will rot in hell
it's the song I hate, it's the song I hate

Re:

Changing the indexing to on does not seem to turn it on, since I just re-uploaded the whole plug-in.

But, before when I was using indexing (by just adding the code you posted above), there was a bug ? whether or not the first letter was capitalized affected the indexing.

For example:

A
abc

A
ABC

black robe and swill
I believe Anita Hill
judge will rot in hell
it's the song I hate, it's the song I hate

Re:

Ah, I'll fix that in 1.2 smile

And I really don't get why the indexing switch isn't working...

I'll also get full language file support ^^ Just noticed that alot of things still aren't in it yikes

Last edited by elbekko (2006-04-03 20:55:31)

Re:

1.2 released. It had something to do with me not reloading the config cache =/ Ah well, fixed now.

Re:

1.2 seems to return an error when using the indexing switch.

In the source code, to fix this issue, I uncommented "Old Query" and commented the "New Query".

It works now. wink

Re:

What error exactly?

Re:

// $db->query("UPDATE `".$db->prefix."config` SET `conf_value` = '" . $indexing . "' WHERE CONVERT( `conf_name` USING utf8 ) = 'o_links_indexing' LIMIT 1") or error("Links Code error2: ".$indexing,__FILE__, __LINE__, $db->error());

I could find the line only by putting 1..2. etc on the error: .. it returned error2: ..

It would only output:

Links Code error2: .

No line or file returned.. so I guessed and comment that only, and uncommented:

    $db->query("UPDATE ".$db->prefix."config SET conf_value='" . $indexing . "' WHERE conf_name='o_links_indexing' LIMIT 1") or error("Links Code error1: ",__FILE__, __LINE__, $db->error());

And now it works! big_smile

Re:

Maybe due to the UTF8 conversion...

Re:

ah.. should try it again and do a mysql_error()..

a suggestion.. maybe have a "if guest, remove the "Submit a new link"" wink

thsi is the rror..

You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'USING utf8 ) = 'o_links_indexing' LIMIT 1' at line 1

Last edited by FreAkErZ (2006-04-22 21:08:07)

Re:

a guset submitting a link is probably problematic .... elbekko help hehe

Re:

I think the solution to that is somewhere on PunRes smile

Re:

So we how to dsable geust of posting links and how to make indexing without errors:


An error was encountered
Error: Links Code error: .

Re:

minis: enable debug mode, so I can see the error

Re:

What debug mode? ;/

Re:

http://punbb.org/forums/viewtopic.php?id=2658

http://fluxbb.org

Free PunBB Hosting - lots of mods, easy to customize