Welcome to Geeklog, Anonymous Saturday, November 23 2024 @ 02:37 pm EST

Geeklog Forums

Autotag - Autolink : Add GL Links as [link]


Status: offline

knuff

Forum User
Full Member
Registered: 12/17/04
Posts: 340
Location:Sweden
Hi,

I made a quick change to the core GL lib-plugins to include the standard web resources of GL.

Two small changes in lib-plugin.php

The first identifies links as part of the Geeklog Core Module.
So around line 946

Text Formatted Code
    // Determine which Core Modules and Plugins support AutoLinks
    //                        'tag'   => 'module'
    //
    // Hack - Autotag Links - Part 1
    // Added standard Geeklog Links.
    $autolinkModules = array ('story' => 'geeklog',
                              'event' => 'geeklog',
                              'link' => 'geeklog'
                             );
 


The second part is just a few lines down.
Around line 1051

Text Formatted Code
                } else if ($autotag['tag'] == 'event') {
                    $autotag['parm1'] = COM_applyFilter ($autotag['parm1']);
                    $url = $_CONF['site_url'] . '/calendar_event.php?eid='
                         . $autotag['parm1'];
                    if (empty ($linktext)) {
                        $linktext = stripslashes (DB_getItem ($_TABLES['events'], 'title', "eid = '{$autotag['parm1']}'"));
                    }
                }
               //
               // Added GL Links - Part 2
               //
                else if ($autotag['tag'] == 'link') {
                    $autotag['parm1'] = COM_applyFilter ($autotag['parm1']);
                    $url = $_CONF['site_url'] . '/portal.php/link/'
                         . $autotag['parm1'];
                    if (empty ($linktext)) {
                        $linktext = stripslashes (DB_getItem ($_TABLES['links'], 'title', "lid = '{$autotag['parm1']}'"));
                    }
                }
                //
                // End Links
                //
 


That´s it.

Now you can just add the lid [link:lid] and the autotags to the rest.

If I missed something, just let me know.

Boris
Vanrillaer.com - our Family Portal
 Quote

Status: offline

beewee

Forum User
Full Member
Registered: 08/05/03
Posts: 969
Location:The Netherlands, where else?
Nice, works like a charm, since I only use Autotags for links I added target=_blank just below to the href tag. Should be part of the core code IMHO (not the target=_blank)
Dutch Geeklog sites about camping/hiking:
www.kampeerzaken.nl | www.campersite.nl | www.caravans.nl | www.caravans.net
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
Quote by beewee: Should be part of the core code IMHO (not the target=_blank)

It already is (in CVS, that is).

bye, Dirk
 Quote

All times are EST. The time is now 02:37 pm.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content