Welcome to Geeklog, Anonymous Wednesday, December 11 2024 @ 02:09 pm EST

Geeklog Forums

Autotag plugin

Page navigation


Status: offline

jmucchiello

Forum User
Full Member
Registered: 08/29/05
Posts: 985
Announcing a new plugin: Autotags 1.0.

Allows the site administrator to create autotags from the admin interface. The plugin features:
  • Text substitution autotags.
  • PHP based autotags using specially named function: phpautotags_yourtag
  • PHP based autotag creation restricted to users with autotags.PHP feature (similar to the staticpages.PHP feature).
  • Autotags can be enabled or disabled individually. (Makes it easier to test them.)
  • Text based autotags use predefined substitution values to make "dynamic" autotags easier to construct. In a tag like this: [yourtag:id Other text] the text autotag can contain #1 and #2 to be replaced by "id" and "Other text" respectively. Other substitutions in #U as your site url and #0 which contains everything after the colon.
  • A userland list of autotags can be attached to the main menu. This list contains all active autotags (including those created by other plugins) with a description of the autotag. The idea is for this to be used as a "help" screen for autotags. Plugins can support this create by creating a plugin_autotag_description_$plugin function to return autotag descriptions. V1.0 of the autotag plugin include description function for the plugins that ship with geeklog.
  • Comes with 4 sample autotags, each initially disabled:
    • poll: links to a poll on the local website
    • topic: a PHP link to a topic on your website, pulls the link text from the database. Also checks that the user seeing the link has access to topic. Otherwise prints Unknown Topic.
    • youtube: duplicates the youtube plugin submitted about a month or two ago.
    • cipher: a PHP letter substitution cipher that shows how rediculous autotags can get. The sample implements rot13. But any letter substitution cipher can be done.
 Quote

Status: offline

jmucchiello

Forum User
Full Member
Registered: 08/29/05
Posts: 985
Can't edit the post above. Here's a link to the download.
 Quote

Status: offline

jmucchiello

Forum User
Full Member
Registered: 08/29/05
Posts: 985
Hi, just wondering if anyone's actually using this. Is anything obvious is missing from it? I'm curious as to what kinds of autotags people have come up with.
 Quote

kazuhiro

Anonymous
Thank you to provide this useful plugin. I use it to create tags for content (not a link) of $_CONF['site_url'] and link to user's profiles.

BTW, I found a bug that plugin can't be enabled to use a function for tags. Because, in function plugin_getListField_autotags, $_AUTO_CONF is not declared as global variable.
 Quote

Status: offline

jmucchiello

Forum User
Full Member
Registered: 08/29/05
Posts: 985
Quote by: kazuhiro

BTW, I found a bug that plugin can't be enabled to use a function for tags. Because, in function plugin_getListField_autotags, $_AUTO_CONF is not declared as global variable.

Dang, the zip has the wrong version of the function.inc file. I'll post a true fix in a couple days but yeah just add $_AUTO_CONF to the list of globals. Glad you like it.
 Quote

Status: offline

samstone

Forum User
Full Member
Registered: 09/29/02
Posts: 820
The plugin doesn't seem to work properly with GL 1.4.1

1) it adds a back slash \ before every double quote or single quote. This can be by passed by use the html code "

2) it addess unwanted url infront of the intended url. Can't find where it comes from.

I just want to create send email like to user to user using "email" as a tag and couldn't acommplish the job.

Sam
 Quote

Status: offline

jmucchiello

Forum User
Full Member
Registered: 08/29/05
Posts: 985
Quote by: samstone

1) it adds a back slash before every double quote or single quote. This can be by passed by use the html code "

Yeah, there's a missing stripslashes around line 281 of functions.inc.
Text Formatted Code
                $subject = stripslashes($record['replacement']);
 Quote

Status: offline

samstone

Forum User
Full Member
Registered: 09/29/02
Posts: 820
Thist still add the slash.

The second problem is not yet resolve, which is the main reason it doesn't work. the tag came out to be something like this:

http://www.domain.com%20"http://www.domain.com/user.php...etc."

Sam
 Quote

Status: offline

jmucchiello

Forum User
Full Member
Registered: 08/29/05
Posts: 985
You will have to post your function or replacement text if you want me to help solve the problem. Use the [ code ] tags to post it.
 Quote

Status: offline

samstone

Forum User
Full Member
Registered: 09/29/02
Posts: 820
I don't need help at this time. My purpose of posting is just to let you know that the plugin doesn't work with GL 1.4.1, at least with url rewrite on. What I have posted so far should give you enough hints to fix the bugs. The preinstalled tags, like YouTube, work.

Thanks,

Sam
 Quote

Status: offline

jmucchiello

Forum User
Full Member
Registered: 08/29/05
Posts: 985
Quote by: samstone

I don't need help at this time.

But I do. I need to know what exactly you are doing that causes my plugin to fail.
My purpose of posting is just to let you know that the plugin doesn't work with GL 1.4.1, at least with url rewrite on.
Why? What happens? Post a full example.
What I have posted so far should give you enough hints to fix the bugs.
Thank you for your faith in my mind reading abilities but frankly I must admit they are not that strong. I can't fix anything based on what you've said so far. I'm asking you for more details.

Here's what I know about the second problem:
2) it addess unwanted url infront of the intended url. Can't find where it comes from.
There are a few words missing there. I understand English may or may not be your first language but I do not understand a word of that.
The second problem is not yet resolve, which is the main reason it doesn't work. the tag came out to be something like this:

http://www.domain.com%20"http://www.domain.com/user.php...etc."
Well, if you enter "$U%20$U/user.php...etc." into the replacement text, you will get that exact result. Since I don't think that's what you entered, I need to know what you did enter in order to get the unexpected result.

Thanks for your help.
 Quote

Status: offline

samstone

Forum User
Full Member
Registered: 09/29/02
Posts: 820
Sorry jmucchiello,

I just don't have time to post the details here. As you see, I didn't even have time to proofread my post.

First, I just needed a simple [email:#] tag and I got it accomplished through hacking lib-plugin.php, with Mark Evens' help.

Second, after trying out your plugin, I found it to be too premature and quite tedious to decribe the bugs in detail.

Third, until your last post, I didn't even know if you are serious about your plugin enough to test it out yourself on a GL1.4.1, as you said you didn't. Some bugs are too obvious that all you need is to drop your plugin in GL1.4.1 by yourself and create a few tags and you will see what I mean. Otherwise, we have to be back and fort forever. Plus, you are not able see the picture from the clues in my posts.

It's not all your fault. I just don't have time to play with it at this time. In any case, you have a neat plugin that has a lot of potential. I hope someone else will have you test it out.

Sam
 Quote

Status: offline

kahall

Forum User
Newbie
Registered: 09/06/04
Posts: 5
I have tried 3 different times to install the autotags plugin and I have installed a few plugins before, but I am not following the INSTALL doc with this one.
So one at a time if you will. I am stuck at step 5 for now.
What exactly do I do with the config.php file that is in the autotags directory?
Do I just insert the code from it into the public_html/config.php?
 Quote

Status: offline

jmucchiello

Forum User
Full Member
Registered: 08/29/05
Posts: 985
You leave it in the autotags directory just like every other plugins. Every plugin has its own config.php. They are independent of the global config.php.

I'll be releasing an update to the autotags plugin in a few days/weeks when I get the time.
 Quote

Status: offline

jmucchiello

Forum User
Full Member
Registered: 08/29/05
Posts: 985
Okay, I finally submitted the 1.01 revision of Autotags. It should be available in a little while.

Fixes the known edit bug.
Adds a new builtin autotag: lang, which grants access to the global LANG variables in your system. Not sure if that's useful but it is amusing inside templates. Not really recommended for general use though as autotags are slower than the template system. It's more of a proof of concept tag.
 Quote

Status: offline

Laugh

Site Admin
Admin
Registered: 09/27/05
Posts: 1470
Location:Canada
I just downloaded the new plugin, thanks for the work.

Two small things:

I have a simple autotag I created that I use in plain text stories for linking to sites.

Text Formatted Code
<a href="http://#1" target="_blank">#2</a>


For the first tag, as long as the URL does not have www. at the begining it will work, if it does the autotag is returned all screwed. Not sure why.

The second thing, I notice was that the Enabled checkbox in the Admin interface allows you to enable it but you can't disable it from here.


One of the Geeklog Core Developers.
 Quote

Status: offline

jmucchiello

Forum User
Full Member
Registered: 08/29/05
Posts: 985
That's an interesting bug. The first thing the story code does when you post a new story (or edit an existing story) is pass the title, intro and content through COM_makeClickableLink(). That function sees www. and assumes you want to turn that into <a href="www. etc.

Later when it calls PLG_replaceTags() to display the content, the autotag receives <a href="www.example.com"></a> in #1 instead of www.example.com. Should I call COM_undoClickableLinks() inside my autotag function? I don't think that will always be correct either.

All I can say is the autotag feature is supposed to make links not parse links. <shrug>

 Quote

Status: offline

ronack

Forum User
Full Member
Registered: 05/27/03
Posts: 612
I'm going to try and explane samstone a little better. I just installed Autotags 1.0.1 and am trying to make a tag for Wikipedia like this. I haven't done any editing of the Plugin.

Tag = wikipedia
Description = Wikipedia entries

Replace with
Text Formatted Code
<a href="http://en.wikipedia.org/wiki/#1">#2</a>


Then I put the tag in a story like so [wikipedia:interestingstuff Some Interesting Page]

The link looks good and comes up

Some Interesting Page

However the URL looks like this
Text Formatted Code
http://www.nc-emt.com/"http://en.wikipedia.org/wiki/iraq/"

As you can see it created the proper link but threw in the extra slashes which I think your code change from above should fix. However it also thows in extra URL info for my site which shouldn't be there.

See it in action http://www.nc-emt.com/article.php?story=20071115180224368

Am I not using it properly or is there a problem?
 Quote

Status: offline

jmucchiello

Forum User
Full Member
Registered: 08/29/05
Posts: 985
I've seen this before but I forget the fix. I'll look into it.
 Quote

Status: offline

ronack

Forum User
Full Member
Registered: 05/27/03
Posts: 612
Cool, thanks!

If you need me to test it just let me know.

Ron
 Quote

Page navigation

All times are EST. The time is now 02:09 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