BLOG:CMS :: Support Forum
Support Forum for BLOG:CMS
You are not logged in.
#1 28.08.2004 00:32
- darkliquid
- BLOG:CMS Junior
- From: Poole, Dorset, UK
- Registered: 25.08.2004
- Posts: 24
- Website
NP_phpGiggle
Hey, I came across the script phpGiggle and liked it a lot, so I modded it into a plugin!
Basically, you give it a bunch of keywords and values, and it will do highlighting, linking, or searches of the keyword based on the value.
I have also extended its capabilities so you can now add your own custom search types.
Anyway, I'm no good at explaining things, why don't you have a look at the plugin and enjoy!
NP_phpGiggle-0.8
Last edited by darkliquid (28.08.2004 00:33)
Offline
#2 31.08.2004 15:51
- Radek Hulán
- Site Admin
- From: Prague, Czech Republic
- Registered: 17.03.2004
- Posts: 2509
- Website
Re: NP_phpGiggle
that's a very useful plugin, thank you!
--= BLOG:CMS developer =--
Offline
#3 02.09.2004 00:00
- darkliquid
- BLOG:CMS Junior
- From: Poole, Dorset, UK
- Registered: 25.08.2004
- Posts: 24
- Website
Re: NP_phpGiggle
Radek Hulán wrote:
that's a very useful plugin, thank you!
Thanks!
I feel the admin section might need a bit of sprucing up, if anyone feels up to the task, then feel free I'll probably give it a go shortly.
Keep me posted on any bugs you see, except for the ones about some keywords being highlighted when within another word, I know about that one and so far I haven't been able to come up with the RegExp to stop it, oh well, I'll keep on plugging away
Offline
#4 22.11.2004 01:17
- pneumapl1
- newbie...
- Registered: 22.11.2004
- Posts: 1
Re: NP_phpGiggle
dont work with 3,5 version?
Code:
Fatal error: Call to a member function on a non-object in /admin/plugins/phpgiggle/index.php on line 9
??
Offline
#5 24.11.2004 08:19
- darkliquid
- BLOG:CMS Junior
- From: Poole, Dorset, UK
- Registered: 25.08.2004
- Posts: 24
- Website
Re: NP_phpGiggle
No it doesn't. When I eventually get round to installing 3.5 on my home server, I'll start hacking at it to make it compatible.
I'm kinda busy at the moment, so it may take a while. Feel free to hack it yourself though and post it here before I do if your able
Offline
#6 03.12.2004 17:16
- darkliquid
- BLOG:CMS Junior
- From: Poole, Dorset, UK
- Registered: 25.08.2004
- Posts: 24
- Website
Re: NP_phpGiggle
I just modified the plugin so it works. All I did was change the
Code:
include($strRel . 'config.php');
line to:
Code:
include($strRel . 'cfg.php');
and it worked fine on my site which is running Blog:CMS 3.5.2
If you made the above adjustment and it still isn't working, I'm not sure quite why that would be.
Offline
#7 04.12.2004 03:57
- greenlight
- BLOG:CMS Junior
- Registered: 14.08.2004
- Posts: 21
Re: NP_phpGiggle
Initially, I had an error on the line:
Code:
$strRel = '../../../';
So, I commented that line out.
Then, I got two errors. The first was:
Warning: main(): Failed opening 'cfg.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /my/path/to/admin/plugins/NP_phpgiggle.php on line 8
I got rid of this by adding my site url in front of the cfg.php file.
The second one was:
Fatal error: Call to a member function on a non-object in /my/path/to/admin/plugins/NP_phpgiggle.php on line 9
I have no idea what is causing that error. Line 9 in the plugin is:
Code:
if (!$member->isLoggedIn())
Any ideas?
Also, I'm just curious if this plugin is what I'm looking for. Will it allow me to automatically display links from keywords in the items, linked keywords that I have set up in the plugin? I'm planning on categorizing names of people and want something that will link to the corresponding category if I enter one of the names in an item.
Last edited by greenlight (04.12.2004 04:10)
Offline
#8 04.12.2004 08:33
- darkliquid
- BLOG:CMS Junior
- From: Poole, Dorset, UK
- Registered: 25.08.2004
- Posts: 24
- Website
Re: NP_phpGiggle
The plugin does:
1) Given a database of keywords, it will replace these keywords with the following:
* If the keyword is provided just a description, it will be replaced with <abbr></abbr> tags providing he description
* If the keyword provides an URL, it will be turned into a link
* If the keyword provides an HTML colour eg #334455 the word will be highlighted that colour
2) In version 0.8 and later, there are custom 'searchwords' they work by:
* Define a searchword, then define the search string as a custom query eg <a href="http://myquery?q=%s">%s</a>. The %s gets replaced with the calling keyword
* when adding a keyword, set its description/searchword as your new search word, and it will be replaced by your own custom replacement
Okay, that wasn't very clear, but I'm not to good at explaining things. I'll have a look at my code about that weird
Code:
if (!$member->isLoggedIn())
bug. Whats strange is that I have no errors at all with it on my own site.
Offline
#9 04.12.2004 08:48
- darkliquid
- BLOG:CMS Junior
- From: Poole, Dorset, UK
- Registered: 25.08.2004
- Posts: 24
- Website
Re: NP_phpGiggle
I think I might have a solution for that bug you mentioned.
Where the code is
Code:
if (!$member->isLoggedIn())
change it to:
Code:
global $member; if (!$member->isLoggedIn())
See if that works
Note: Currently, the admin area for the plugin is quite lacking as I've never been particularly inclined to improve it and I basically suck at user-friendliness. It's usable, and it does its job though. The only things that really need improving are the Edit 'whatever' sections and the 'Add keyword' section so that you can actually edit the items instead of just replace them and also so you can see a list of available searchwords. Actually, the opening page could be immproved to show a list of currently defined keywords and searchwords. Hmmm. I'll get on it eventually
Offline
#10 04.12.2004 13:48
- greenlight
- BLOG:CMS Junior
- Registered: 14.08.2004
- Posts: 21
Re: NP_phpGiggle
After that change, I encountered another error for this line:
Code:
include($DIR_LIBS . 'PLUGINADMIN.php');
So, I added my url path to the pluginadmin.php file and got rid of that error. However, there is another error now:
Fatal error: Cannot instantiate non-existent class: pluginadmin in /my/path/to/admin/plugins/NP_phpgiggle.php on line 16
Line 16 reads:
Code:
$oPluginAdmin = new PluginAdmin('phpGiggle');
Now what?
Offline