new bug in free-tag-plugin
-
- Regular
- Posts: 1531
- Joined: Tue Mar 07, 2006 11:25 pm
- Location: Berlin, Germany
- Contact:
new bug in free-tag-plugin
Hello,
I updated the plugin via Spartacus today and there is a little bug:
In the tag-cloud in the sidebar, the path in the tag-links has an error:
http://blog.stephan.manske-net.de/
the links are relative to the actual path, so on the main page the link for the tag test shows to http://blog.stephan.manske-net.de/test and not to http://blog.stephan.manske-net.de/plugin/tag/test On a category page it shows to http://blog.stephan.manske-net.de/categories/test
In the footer, the "tags for this article" is always correct.
I updated the plugin via Spartacus today and there is a little bug:
In the tag-cloud in the sidebar, the path in the tag-links has an error:
http://blog.stephan.manske-net.de/
the links are relative to the actual path, so on the main page the link for the tag test shows to http://blog.stephan.manske-net.de/test and not to http://blog.stephan.manske-net.de/plugin/tag/test On a category page it shows to http://blog.stephan.manske-net.de/categories/test
In the footer, the "tags for this article" is always correct.
Ciao, Stephan
-
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Re: new bug in free-tag-plugin
Hi!
What did you configure as the base taglink in the freetag plugin config?
Where exactly does the wrong link show up, can you give me an exact URL?
Best regards,
Garvin
What did you configure as the base taglink in the freetag plugin config?
Where exactly does the wrong link show up, can you give me an exact URL?
Best regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
-
- Regular
- Posts: 1531
- Joined: Tue Mar 07, 2006 11:25 pm
- Location: Berlin, Germany
- Contact:
Re: new bug in free-tag-plugin
In the event plugin?What did you configure as the base taglink in the freetag plugin config?
http://blog.stephan.manske-net.de/plugin/tag/
As I said:Where exactly does the wrong link show up, can you give me an exact URL?
Go to http://blog.stephan.manske-net.de/, on the sidebar are the tags. They shows to http://blog.stephan.manske-net.de/bla
Go to a category http://blog.stephan.manske-net.de/categories/19-test4, they shows to http://blog.stephan.manske-net.de/categories/bla
go to an article http://blog.stephan.manske-net.de/archives/3-twssw.html they show to http://blog.stephan.manske-net.de/archives/bla
BUT, the tags in the footer of this article are correct!
http://blog.stephan.manske-net.de/plugin/tag/test
And this is the same, when you see the article on the main page http://blog.stephan.manske-net.de/archives/P2.html
Ciao, Stephan
Re: new bug in free-tag-plugin
I can confirm this bug. I configured the 'Taglink' to be http://www.compyblog.de/index.php?/plugin/tag/ but my blog shows the links in the tagcloud (via sidebar plugin) on my blog as http://www.compyblog.de/Abmahnwellen etc.garvinhicking wrote:Hi!
What did you configure as the base taglink in the freetag plugin config?
Where exactly does the wrong link show up, can you give me an exact URL?
Best regards,
Garvin
It looks like the sidebar plugin for tagging is not completely adapted to the event plugin. This is serendipity_plugin_freetag version 2.37 and serendipity_event_freetag version 2.61.
-
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Re: new bug in free-tag-plugin
Hi!
Ah, okay. The sidebar plugin could not get the taglink configuration option from the event plugin, thus I needed to insert the config option to the sidebar plugin as well.
Best regards,
Garvin
Ah, okay. The sidebar plugin could not get the taglink configuration option from the event plugin, thus I needed to insert the config option to the sidebar plugin as well.
Best regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
-
- Regular
- Posts: 1531
- Joined: Tue Mar 07, 2006 11:25 pm
- Location: Berlin, Germany
- Contact:
OK, I think I have the source of the error:
It ist the new feature to config the path manualy.
The tag cloud for the sidebar is called from plugin_freetag.php
It uses for the displaying a function in event_freetag.php.
In these function there is a piece of code which is in all of the functions in these file:
But in these special function $this->get_config('taglink') is empty. I think, because the function is called in the context of plugin_freetag, which did not know taglink. So $this-> seems to be the wrong way - but is there a possibility to access the config of event_freetag with another php-construct?
by the way: In what way are all these config options saved in s9y? What do s9y open to read out the saved options?
It ist the new feature to config the path manualy.
The tag cloud for the sidebar is called from plugin_freetag.php
It uses for the displaying a function in event_freetag.php.
In these function there is a piece of code which is in all of the functions in these file:
Code: Select all
function displayTags($tags, $xml, $nl, $scaling, $maxSize = 200, $minSize = 100)
{
global $serendipity;
static $taglink = null;
if ($taglink == null) {
$taglink = $this->get_config('taglink');
}
by the way: In what way are all these config options saved in s9y? What do s9y open to read out the saved options?
Ciao, Stephan
-
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Hi!
stm: Yes, that was what I meant
I think there is a way to retrieve the event plugin config option, some other bundled plugins do that - but it was too complicated for me to look into right now, so I went the easier route.
Best regards,
Garvin
stm: Yes, that was what I meant
I think there is a way to retrieve the event plugin config option, some other bundled plugins do that - but it was too complicated for me to look into right now, so I went the easier route.
They are all stored in the serendipity_config DB table, and saved by the primary key association of the plugin's ID.by the way: In what way are all these config options saved in s9y? What do s9y open to read out the saved options?
Best regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
-
- Regular
- Posts: 1531
- Joined: Tue Mar 07, 2006 11:25 pm
- Location: Berlin, Germany
- Contact:
Yeah, but I begin to write my post before you post yours - but it takes some time to end my poststm: Yes, that was what I meant
Can you tell me one (ore more!) of these bundled plugins? Perhaps I have the timeI think there is a way to retrieve the event plugin config option, some other bundled plugins do that - but it was too complicated for me to look into right now, so I went the easier route.
Ciao, Stephan
-
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Hi!
Regards,
Garvin
The "user self-registration" plugin is the most obvious, I think.Can you tell me one (ore more!) of these bundled plugins? Perhaps I have the time
Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
-
- Regular
- Posts: 1531
- Joined: Tue Mar 07, 2006 11:25 pm
- Location: Berlin, Germany
- Contact:
Hm, I would think these is responsable for the cross-over using of config variables:
So, code like this can be helpfull:
Code: Select all
// Get the config from the sidebar plugin
$pair_config = array(
'userlevel' => USERLEVEL_EDITOR,
'no_create' => false,
'right_publish' => false,
'instructions' => $this->get_config('instructions', ''),
'usergroups' => array(),
'straight_insert' => false
);
$config = serendipity_db_query("SELECT name, value FROM {$serendipity['dbPrefix']}config WHERE name LIKE 'serendipity_plugin_adduser:%'");
if (is_array($config)) {
foreach($config AS $conf) {
$names = explode('/', $conf['name']);
if ($names[1] == 'instructions' && !empty($pair_config['instructions'])) {
continue;
}
if ($names[1] == 'usergroups') {
$ug = (array)explode(',', $conf['value']);
foreach($ug AS $cid) {
if ($cid === false || empty($cid)) {
continue;
}
$pair_config[$names[1]][$cid] = $cid;
}
} else {
$pair_config[$names[1]] = serendipity_get_bool($conf['value']);
}
}
}
So, code like this can be helpfull:
Code: Select all
// Get the config from the sidebar plugin
$pair_config_taglink = null;
$config = serendipity_db_query("SELECT name, value FROM {$serendipity['dbPrefix']}config WHERE name LIKE 'serendipity_event_freetag:%taglink'");
if (is_array($config)) {
foreach($config AS $conf) {
$names = explode('/', $conf['name']);
if ($names[1] == 'taglink' && empty($pair_config_taglink)) {
$pair_config_taglink = ($conf['value']);
}
}
}
Ciao, Stephan
-
- Regular
- Posts: 1531
- Joined: Tue Mar 07, 2006 11:25 pm
- Location: Berlin, Germany
- Contact:
I tryed the code at http://nopaste.php-q.net/228734 in the event_freetag.php V2.61 and it worked fine! No need to config taglink in both configs!
Ciao, Stephan
-
- Regular
- Posts: 1531
- Joined: Tue Mar 07, 2006 11:25 pm
- Location: Berlin, Germany
- Contact:
Thanks for your code snippet, works as expected. Only issue I got was that I had to make the query more general because I only found a serendipity_PLUGIN_freetag entry in my DB ... and no serendipity_EVENT_freetag (however, it's my local dev blog, so some things might be broken there):
Cheers
- Mattsches
Code: Select all
$result_taglink = serendipity_db_query("SELECT name, value FROM {$serendipity['dbPrefix']}config WHERE name LIKE '%freetag%taglink'");
- Mattsches