Welcome to Geeklog, Anonymous Saturday, July 12 2025 @ 06:50 pm EDT
Geeklog Forums
Autotag - Autolink : Add GL Links as [link]
Status: offline
Forum User
Full Member
Registered: 12/17/04
Posts: 340
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
// '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
$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
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
10
12
Quote
Status: offline
Forum User
Full Member
Registered: 08/05/03
Posts: 969
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)
10
12
Quote
Status: offline
Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Quote by beewee: Should be part of the core code IMHO (not the target=_blank)
It already is (in CVS, that is).
bye, Dirk
12
12
Quote
All times are EDT. The time is now 06:50 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