Recent Topics

1 Apr 23, 2008 13:43    

Hi EdB

I've installed 'your' More Tags plugin and thanks.

As I wanted something a bit different I thought I'd look at the code. I'm not a boffin like you but it doesn't look to difficult to alter some parameters.

So my questions are;

1. Can I install another instance? What's this

	var $number_of_installs = 1;

2. Or should I rename the plugin and lots of the internal variables to avoid a conflict.

What I intend doing is to enable background colours, like highlighting and or spans and not divs.



2 Apr 23, 2008 13:58

Hmmm... I think what you should do is copy it with a new name and change the bit at the very top of the plugin that calls it's own name. Somewhere in there it will say "moretags_plugin does something to class" or something like that. That particular bit needs to match the file name and the folder name. That should be a good clue as to how to simply duplicate it. After that you would only need to change the details you want to change - not all the various variable names.

So like folder "moretags_plugin" has file "_moretags.plugin.php" and a line with "moretags_plugin extends blah blah" in it becomes "mymoretags_plugin" folder with "_mymoretags.plugin.php" file in it and a line that now says "mymoretags_plugin extends blah blah".

Then upload the new version and cross your fingers and see what you get.

BTW I've been way too busy with a stupid form (that does a really cool trick) and haven't played with a big backlog of issues with plugins. If you let me know what kind of details you're looking for I'll see about adding them to a "next gen" plugin. For example I hate how the div buttons show up if you use them or not, and how you can't give them a custom name. Those details will be fixed in the next release. And maybe stuff like adding your own colors or replacing existing ones with your own. And if I can figure out how a method to do what you want: add something specific to the look and feel of your own blog.

3 Apr 23, 2008 14:25

Thanks EdB

I'm having fun. I've just altered some of the code and css of your version and everything is fine.

Specifically as I use a white background I didn't want to use YELLOW text so I've hack the plugin to show a small 'y' on the button, changed the name of the class to _yellow_back etc. and changed the css to background instead of color.

Simple, brilliant, exactly what I wanted, I'm over the moon. If only everyone could be so happy will such a simple solution to all their desire.

Thanks very much. Now I have a twinkling of what the insides of plugin looks like and what it can do.

4 Apr 23, 2008 14:58

Deconstructing a plugin that you find useful, then making it be even betterer, is the best possible way to learn the plugin system. It is, in fact, how all the truly great plugin authors get started. By the way it's what I do ;)

Cool so flexing the colors is a good idea, but adding in the idea of "text or background" for any given color is a great idea.

5 Apr 23, 2008 15:30

You haven't seen a picture of me yet. That's not all you do :D

I've managed to hack the folder, file and class name to mytags and fiddled with the comments

 * READ THE README! That's where all the answers to all your questions are!
 * This plugin is a the grandchild of the "quicktags" plugin.  In fact, it
 * was/is EdB's 'More Tags' plugin that I fiddled to produce different effects..
 * This plugin is released into the wilds with the same license as b2evolution.
 * Latest hacker : amoun

so i'm learning.

Going to the garden now to get some sun.

Back on the blog machine later.


Form is loading...

b2evolution CMS – This forum is powered by b2evolution CMS, a complete engine for your website.