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

Topic: Links Page 1.2

##
##
##        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

Re: Links Page 1.2

nice! thanks for the share.

~James
FluxBB - Less is more

3

Re: Links Page 1.2

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

4

Re: Links Page 1.2

Installed! Pretty nifty, thank you.

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

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

Re: Links Page 1.2

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

Re: Links Page 1.2

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: Links Page 1.2

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

8

Re: Links Page 1.2

Sick!

Thank you!!

9

Re: Links Page 1.2

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: Links Page 1.2

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

11

Re: Links Page 1.2

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

12

Re: Links Page 1.2

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

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

Re: Links Page 1.2

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

Re: Links Page 1.2

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

Re: Links Page 1.2

What error exactly?

Re: Links Page 1.2

Maybe due to the UTF8 conversion...

17

Re: Links Page 1.2

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

Re: Links Page 1.2

I think the solution to that is somewhere on PunRes smile

19

Re: Links Page 1.2

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: Links Page 1.2

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

21

Re: Links Page 1.2

What debug mode? ;/

Re: Links Page 1.2

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

http://fluxbb.org

Free PunBB Hosting - lots of mods, easy to customize

23

Re: Links Page 1.2

...why links open in _self why not in _blank ? i don't understeand how is _self better of _blank...

it's just me...

Re: Links Page 1.2

Well, just add target="_blank" if you want to use it =/ It actually is annoying for IE users, because those poor persons don't have tabs wink

25 (edited by minis 2006-06-04 15:15)

Re: Links Page 1.2

An error was encountered
File: /***/punbb/plugins/AMP_Moderate_Links.php
Line: 55

PunBB reported: Links Code error:

Database reported: 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 (Errno: 1064)