forum.coppermine-gallery.net

Support => cpg1.5 plugins => cpg1.5.x Support => cpg1.5 plugin contributions => Topic started by: Αndré on January 05, 2009, 02:14:00 pm

Title: BBCode Control (more bbcodes, buttons and adjustment) for cpg1.5.x
Post by: Αndré on January 05, 2009, 02:14:00 pm
What it does:

A new button appears in the admin menu. There you can set everything related to bbcodes.

Download: http://sourceforge.net/projects/coppermine/files/Plugins/1.5.x/cpg1.5.x_plugin_bbcode_control_v1.11.zip/download
Title: Re: Plugin: BBCode Control for CPG 1.5.x
Post by: Hein Traag on January 05, 2009, 02:15:43 pm
Nice work work eenemeenemuu ! Definately going into a site i'm working. Thanks.
Title: Re: Plugin: BBCode Control (more bbcodes and adjustment) for CPG 1.5.x
Post by: Αndré on January 05, 2009, 02:26:10 pm
Any translations are welcome :) Currently only english and german are included in the package. I've implemented a language fallback and the most output is for the admin only. That means, that my plugin can be used on websites in every language anyway, even if there don't exist a language file.
Title: Re: Plugin: BBCode Control (more bbcodes and adjustment) for CPG 1.5.x
Post by: Hein Traag on January 05, 2009, 03:08:04 pm
And here is the dutch lang file.

Cheers
Hein
Title: Re: Plugin: BBCode Control (more bbcodes and adjustment) for CPG 1.5.x
Post by: Fabricio Ferrero on January 05, 2009, 07:06:11 pm
And the Spanish one!

Again, Nice plugin!


Cheers

Fabricio.
Title: Re: Plugin: BBCode Control (more bbcodes and adjustment) for CPG 1.5.x
Post by: François Keller on January 05, 2009, 08:58:42 pm
Nice plugin
attached french.php file
BTW you should add the header to your lang files.
Title: Re: Plugin: BBCode Control (more bbcodes and adjustment) for CPG 1.5.x
Post by: Αndré on January 06, 2009, 08:15:05 am
Thank you for your contributions. I added your language files to the package and updated the first post.

you should add the header to your lang files.
Done for all available language files.
Title: Re: BBCode Control (more bbcodes, buttons and adjustment) for cpg1.5.x
Post by: Joachim Müller on May 24, 2009, 10:35:11 am
eenemeenemuu has added the plugin to the SVN, so those of you who want to see the cutting edge of this plugin are welcome to check out the SVN via web access (http://coppermine.svn.sourceforge.net/viewvc/coppermine/branches/cpg1.5.x/plugins/bbcode_control/) or using your favorite SVN client (see http://documentation.coppermine-gallery.net/en/dev_subversion.htm) and check out
Code: [Select]
https://coppermine.svn.sourceforge.net/svnroot/coppermine/branches/cpg1.5.x/plugins/bbcode_control/. Please remember though that SVN checkouts don't get supported.

Joachim
Title: Re: BBCode Control (more bbcodes, buttons and adjustment) for cpg1.5.x
Post by: Αndré on June 11, 2010, 12:11:53 pm
Version 1.8 uses youtube-nocookie.com to embed youtube videos.
Title: Re: BBCode Control (more bbcodes, buttons and adjustment) for cpg1.5.x
Post by: ssdaa on June 13, 2010, 08:18:50 pm
Thank you Αndré
attache arabic
Title: Re: BBCode Control (more bbcodes, buttons and adjustment) for cpg1.5.x
Post by: Αndré on June 13, 2010, 08:31:49 pm
Thanks for your contribution. Added Arabic language file in r7678.
Title: Re: BBCode Control (more bbcodes, buttons and adjustment) for cpg1.5.x
Post by: marish on June 29, 2010, 03:29:05 am
hi, thanks for great plugin!

i would like to ask, if there is a posibility to generate pre-built bbcodes for whole album in single textarea on album page?
i found a few mods trying to do this, but none of them work on version 1.5.
it would be much appreciated.  :)

cheers,
marish
Title: Re: BBCode Control (more bbcodes, buttons and adjustment) for cpg1.5.x
Post by: Αndré on June 29, 2010, 08:14:28 am
What do you mean with 'album page'? What exactly do you want to display where? Board rules / Forum policies: Post Links (http://forum.coppermine-gallery.net/index.php/topic,55415.msg270616.html#msg270616)?
Title: Re: BBCode Control (more bbcodes, buttons and adjustment) for cpg1.5.x
Post by: marish on June 29, 2010, 02:40:02 pm
thanks for your reply.
i mean this page: http://miliarda.com/marish/cpg/thumbnails.php?album=1
and i would like to display a list of bbcodes for all photos in this album in single textarea, which should be placed at the bottom of that page.

photobucket.com has similar feature, please look at the attachment.
Title: Re: BBCode Control (more bbcodes, buttons and adjustment) for cpg1.5.x
Post by: Joachim Müller on June 29, 2010, 03:04:44 pm
That's an entirely different plugin - it does something completely different than this plugin. This plugin here allows the use of additional bbcode tags in the fields that already exist in Coppermine. What you request is a plugin that adds field(s) where a link to the page the visitor is on is being displayed in a fool-proof manner for copy'n paste purposes. You shouldn't have posted in this thread. There are a number of plugins (e.g. "copy/ paste bbcode img URL below intermediate image (http://forum.coppermine-gallery.net/index.php/topic,36302.html)" and "TagBlitz 1.0 (stable) - Linking suite (HTML, bbCode, tags, social bookmarking) (http://forum.coppermine-gallery.net/index.php/topic,31833.html)") for cpg1.4.x that would have to be ported for cpg1.5.x, but that's beyond the scope of this thread. Your request is invalid. Please do not discuss your request further in this thread.
Title: Re: BBCode Control (more bbcodes, buttons and adjustment) for cpg1.5.x
Post by: Αndré on June 29, 2010, 03:16:37 pm
Please read the feature list
  • Show pre-built bbcode in file info. You can copy & paste the bbcode wherever you want.

You want to display BBCodes for all images of an album, right? I'll create a draft of what I've understood from your request. But please:
Please do not discuss your request further in this thread.
instead just wait until I upload that plugin.
Title: Re: BBCode Control (more bbcodes, buttons and adjustment) for cpg1.5.x
Post by: marish on June 29, 2010, 03:25:31 pm
yes, that is exactly what i mean. thank you and i`m sorry for misplacing this request, i`ll be more careful about forum structure next time. feel free to delete my posts from this thread. :)
Title: Re: BBCode Control (more bbcodes, buttons and adjustment) for cpg1.5.x
Post by: Αndré on June 29, 2010, 03:50:17 pm
For all who are searching a plugin which features marish's request (and all related discussion!), see here (http://forum.coppermine-gallery.net/index.php/topic,65779.0.html).
Title: Re: BBCode Control (more bbcodes, buttons and adjustment) for cpg1.5.x
Post by: Akuma2000 on October 15, 2010, 03:53:59 pm
I installed this one, works great :)

But when I copy the BB code of an image and post it on a forum, it shows the thumbnail on the forum.
Is there a way to show the full size of that image?
Title: Re: BBCode Control (more bbcodes, buttons and adjustment) for cpg1.5.x
Post by: Αndré on October 15, 2010, 04:01:16 pm
Is there a way to show the full size of that image?
In codebase.php, find
Code: [Select]
$thumb = '[img]'.$CONFIG['ecards_more_pic_target'].get_pic_url($CURRENT_PIC_DATA, 'thumb').'[/img]';and replace with
Code: [Select]
$thumb = '[img]'.$CONFIG['ecards_more_pic_target'].get_pic_url($CURRENT_PIC_DATA, 'fullsize').'[/img]';
Title: Re: BBCode Control (more bbcodes, buttons and adjustment) for cpg1.5.x
Post by: Akuma2000 on October 15, 2010, 04:09:55 pm
Wow you're fast! Thanks :)

That worked! But another small issue, when you click on the image, it opens two new windows.
1x Gallery and 1x Picture fullsized.

Can it be adjusted that it only shows the fullsized image?

(check it here by the way: http://forum.highflow.nl/f2/highflow-gallery-http-gallery-highflow-nl-8017/index2.html#post145421)
Title: Re: BBCode Control (more bbcodes, buttons and adjustment) for cpg1.5.x
Post by: Αndré on October 15, 2010, 04:16:58 pm
it opens two new windows.
1x Gallery and 1x Picture fullsized
That's a feature of your board application.

In codebase.php, find
Code: [Select]
$info['BBCode'] = '<textarea onfocus="this.select();" onclick="this.select();" class="textinput" rows="1" cols="64" wrap="off" style="overflow:hidden; height:15px;">[url='.$url.']'.$thumb.'[/url]</textarea>';and replace with
Code: [Select]
$info['BBCode'] = '<textarea onfocus="this.select();" onclick="this.select();" class="textinput" rows="1" cols="64" wrap="off" style="overflow:hidden; height:15px;">'.$thumb.'</textarea>';
Title: Re: BBCode Control (more bbcodes, buttons and adjustment) for cpg1.5.x
Post by: Akuma2000 on October 15, 2010, 04:30:06 pm
Thanks!!! Now it's working correctly for us :)
Title: Re: BBCode Control (more bbcodes, buttons and adjustment) for cpg1.5.x
Post by: lurkalot on October 19, 2010, 10:04:57 am
In codebase.php, find
Code: [Select]
$thumb = '[img]'.$CONFIG['ecards_more_pic_target'].get_pic_url($CURRENT_PIC_DATA, 'thumb').'[/img]';and replace with
Code: [Select]
$thumb = '[img]'.$CONFIG['ecards_more_pic_target'].get_pic_url($CURRENT_PIC_DATA, 'fullsize').'[/img]';

Andre, great plugin, thanks.  ;)

I edited the code you mentioned above, and changed the embedded pic from 'thumb' to 'normal'.  When clicked it takes you to the gallery page showing the normal pic.  Is there a way to make it when clicked to take you to the full sized image?  In fact two BBcode lines would be handy, one for normal, and one for full size, (when clicked).
Title: Re: BBCode Control (more bbcodes, buttons and adjustment) for cpg1.5.x
Post by: Αndré on November 01, 2010, 12:35:06 pm
When clicked it takes you to the gallery page showing the normal pic.  Is there a way to make it when clicked to take you to the full sized image?  In fact two BBcode lines would be handy, one for normal, and one for full size, (when clicked).
Open codebase.php, find
Code: [Select]
$info['BBCode'] = '<textarea onfocus="this.select();" onclick="this.select();" class="textinput" rows="1" cols="64" wrap="off" style="overflow:hidden; height:15px;">[url='.$url.']'.$thumb.'[/url]</textarea>';and replace with
Code: [Select]
$info['BBCode normal size'] = '<textarea onfocus="this.select();" onclick="this.select();" class="textinput" rows="1" cols="64" wrap="off" style="overflow:hidden; height:15px;">[url='.$url.']'.$thumb.'[/url]</textarea>';
$info['BBCode full size'] = '<textarea onfocus="this.select();" onclick="this.select();" class="textinput" rows="1" cols="64" wrap="off" style="overflow:hidden; height:15px;">[url='.$url.'&fullsize=1]'.$thumb.'[/url]</textarea>';

Is this what you asked for?
Title: Re: BBCode Control (more bbcodes, buttons and adjustment) for cpg1.5.x
Post by: lurkalot on November 01, 2010, 07:07:22 pm

Is this what you asked for?


Andre Thanks, I think so, but unfortunately it give me a error when I replace that code you just gave me.  ???  It Say's,

Quote
Parse error: syntax error, unexpected T_IF in /home/camxxxxx/public_html/gallery/plugins/bbcode_control/codebase.php on line 1
Title: Re: BBCode Control (more bbcodes, buttons and adjustment) for cpg1.5.x
Post by: Αndré on November 01, 2010, 08:53:10 pm
Quote
codebase.php on line 1
Please undo your last change and try again. I assume you've done something wrong, as you don't have to edit line 1.
Title: Re: BBCode Control (more bbcodes, buttons and adjustment) for cpg1.5.x
Post by: lurkalot on November 01, 2010, 09:47:47 pm
Andre, you're right. Sorry it was me after all.  Not sure what I'd done wrong, but edited the file again, and it works perfectly now.

Cheers.  You're a star ;)
Title: Re: BBCode Control (more bbcodes, buttons and adjustment) for cpg1.5.x
Post by: lurkalot on November 01, 2010, 10:16:51 pm
Forgot to add a screengrab to my last post.  Here it is for anyone who's interested.  ;)
Title: Re: BBCode Control (more bbcodes, buttons and adjustment) for cpg1.5.x
Post by: hanzon2010 on November 25, 2010, 12:53:14 pm
Hello, Andre,

Is it possible to add the
bb codes ?

Like this one : http://www.teamopolis.com/tools/bbcode-table-generator.aspx

Or the Table Bbcode shown in this forum while posting.

Thanks ...
Title: Re: BBCode Control (more bbcodes, buttons and adjustment) for cpg1.5.x
Post by: Αndré on November 25, 2010, 05:58:28 pm
Have a look at codebase.php. It's very easy to add those tags, as you simply have to replace [ with < and ] with >. I'm currently very busy, that's why I cannot release a new version.
Title: Re: BBCode Control (more bbcodes, buttons and adjustment) for cpg1.5.x
Post by: hanzon2010 on November 25, 2010, 11:22:20 pm
Thank you, sir.  I managed to do it, but I can't get any columns, just rows ...

I tried to add  hoping to get it over with this bbcode, and have a more powerful way of formatting descriptions, but didn't work.  I guess I have to study this Coppermine program more.  Adding this html bbcode will surely make Coppermine a very powerful application.
Title: Re: BBCode Control (more bbcodes, buttons and adjustment) for cpg1.5.x
Post by: Αndré on November 26, 2010, 08:00:21 am
Please post your modifications.
Title: Re: BBCode Control (more bbcodes, buttons and adjustment) for cpg1.5.x
Post by: hanzon2010 on November 26, 2010, 10:18:00 am
Oh, I was only trying out your suggestion in a quick manner, I'm no php programmer, so I was just trying to figure out.  So I added the table codes, and 'html' as well.  I don't get images of course in the Config section, but I am able to select the radio buttons and save settings (although the radio buttons are not selected when I go back to the config section later). 

Anyway, here is what I was doing ...

codebase.php
==========
Under function new_bbcodes:
:
:
// tables
    if (!in_array('table', $bbcode_tags_disabled)) {
        $text = str_replace("
", "<table>", $text);
        $text = str_replace("
", "</table>", $text);
    }

    if (!in_array('tr', $bbcode_tags_disabled)) {
        $text = str_replace("
", "<tr>", $text);
        $text = str_replace("
", "</tr>", $text);
    }

    if (!in_array('th', $bbcode_tags_disabled)) {
        $text = str_replace("[th]", "<th>", $text);
        $text = str_replace("[/th]", "</th>", $text);
    }

    if (!in_array('td', $bbcode_tags_disabled)) {
        $text = str_replace("
", "<td>", $text);
        $text = str_replace("
", "</td>", $text);
    }
   
    if (!in_array('html', $bbcode_tags_disabled)) {
        $text = str_replace("", "<html>", $text);
        $text = str_replace("", "</html>", $text);
    }
:
:

function get_bbcode_tags($which) {
    // available tags
    $bbcode_tags_available = array(
        'b', // cpg standard
        'u', // cpg standard
        'i', // cpg standard
        's', // cpg standard
        'size',
        'tt',
        'color', // cpg standard
        'hr',
        'quote',
        'url', // cpg standard
        'img', // cpg standard
        'table',
        'tr',
        'th',
        'td',
        'html',

        'youtube',
    );



english.php
========

// admin.php & codebase.php
$lang_plugin_bbcode_control['b'] = 'Bold';
$lang_plugin_bbcode_control['u'] = 'Underline';
$lang_plugin_bbcode_control['i'] = 'Italic';
$lang_plugin_bbcode_control['s'] = 'Strikethrough';
$lang_plugin_bbcode_control['img'] = 'Image';
$lang_plugin_bbcode_control['url'] = 'Link';
$lang_plugin_bbcode_control['color'] = 'Font color';
$lang_plugin_bbcode_control['size'] = 'Font size';
$lang_plugin_bbcode_control['quote'] = 'Quote';
$lang_plugin_bbcode_control['youtube'] = 'Youtube video';
$lang_plugin_bbcode_control['tt'] = 'Teletype';
$lang_plugin_bbcode_control['hr'] = 'Horizontal rule';
$lang_plugin_bbcode_control['hr'] = 'Horizontal rule';
$lang_plugin_bbcode_control['hr'] = 'Horizontal rule';
$lang_plugin_bbcode_control['hr'] = 'Horizontal rule';
$lang_plugin_bbcode_control['hr'] = 'Horizontal rule';
$lang_plugin_bbcode_control['table'] = 'table';
$lang_plugin_bbcode_control['tr'] = 'tr';
$lang_plugin_bbcode_control['td'] = 'td';
$lang_plugin_bbcode_control['th'] = 'th';
$lang_plugin_bbcode_control['html'] = 'html';



*  by the way, the Preview button for this section of posting reply does not seem to work (alt+p also).
Title: Re: BBCode Control (more bbcodes, buttons and adjustment) for cpg1.5.x
Post by: hanzon2010 on November 26, 2010, 01:23:41 pm
Sorry, I just realized the items in between "[]" have not been shown, please ignore above, will post a screen capture version instead.
Title: Re: BBCode Control (more bbcodes, buttons and adjustment) for cpg1.5.x
Post by: hanzon2010 on November 29, 2010, 08:32:15 am
Hi, Andre,

Here are the codes changed - codebase.php and english.php

http://www.photofilma.com/bbcode-change.txt (http://www.photofilma.com/bbcode-change.txt)
Title: Re: BBCode Control (more bbcodes, buttons and adjustment) for cpg1.5.x
Post by: hanzon2010 on December 06, 2010, 02:20:56 pm
I finally got the bbcode for tables to work after changing the code as mentioned above.  I just uninstalled the BBCode Control plugin and reinstalled it, and now my new table BB codes have been saved into the SQL database.

Thanks, Andre, for leading the way ...

Now looking into how to get html to work ...  8)

Title: Re: BBCode Control (more bbcodes, buttons and adjustment) for cpg1.5.x
Post by: André Müller on January 22, 2011, 01:18:58 pm
Very nice plugin!
I am wondering weather it is possible to make the pre-formatted BBCodes in the file infos only visible for registered users or admins (like the link for the statistics)?

Cheers,
André

www.fotowald.de
www.above-horizon.de
Title: Re: BBCode Control (more bbcodes, buttons and adjustment) for cpg1.5.x
Post by: cavok on February 19, 2011, 08:06:35 pm
Hello,
Would be it possible to use this plugin not only for the comments, but wherever it is possible to write.
As the title, description of images in ""Edit Files" and "Edit file informations".
E-cards.
Thank's for your help.
Title: Re: BBCode Control (more bbcodes, buttons and adjustment) for cpg1.5.x
Post by: Αndré on February 23, 2011, 11:08:28 am
That should be possible, but I think I won't implement it in the near future, as I'm too busy. Sorry.
Title: Re: BBCode Control (more bbcodes, buttons and adjustment) for cpg1.5.x
Post by: Mimer on March 05, 2011, 12:48:41 am
Danish languagefile for BBCode Control plugin.

Mimer  8)
Title: Re: BBCode Control (more bbcodes, buttons and adjustment) for cpg1.5.x
Post by: Αndré on March 05, 2011, 10:49:10 am
Thank you for your contribution. Danish language file added in svn revision 8188.
Title: Re: BBCode Control (more bbcodes, buttons and adjustment) for cpg1.5.x
Post by: phill104 on April 01, 2011, 10:33:08 pm
Some thoughts on enhancements that I would love to see.

Actual buttons directly under the intermediate images with copy to clipboard for image link to intermediate or thumb and a button to embed the intermediate or thumb with link in a forum

Those buttons should be selectable in the admin panel so the user can select whether the links should be to intermediate or thumb or even fullsize image.
Title: Re: BBCode Control (more bbcodes, buttons and adjustment) for cpg1.5.x
Post by: Αndré on April 02, 2011, 01:58:51 pm
Thank you for your suggestion. I want to remove that feature from this plugin and create a new one with much more embedding options since some months, but haven't done yet because of little time and too little personal needs, but I'll add your suggestion to the new plugin if I'll create it sometime in the future :)
Title: Re: BBCode Control (more bbcodes, buttons and adjustment) for cpg1.5.x
Post by: phill104 on April 02, 2011, 09:07:49 pm
Yep, I think it would be a good idea to have separate plugins for the bbcode buttons and this. We had a mod Stramm (iirc) made for 1.4.x and it was quite popular for the bbcode buttons but it took fiddling with code to choose the sizes of images. Made as a plugin with options in the back end would work really well.
Title: Re: BBCode Control (more bbcodes, buttons and adjustment) for cpg1.5.x
Post by: Αndré on May 20, 2011, 12:34:56 pm
Version 1.9 adds support for short YouTube urls.
Title: Re: BBCode Control (more bbcodes, buttons and adjustment) for cpg1.5.x
Post by: profili on August 05, 2011, 02:57:03 am
I have a question: how can I add the BBCode fild under the photo. I find that under file information area it is too hidden and most of the users wont notice it.
Title: Re: BBCode Control (more bbcodes, buttons and adjustment) for cpg1.5.x
Post by: GeoffTheBeard on September 15, 2011, 10:05:54 pm
What it does:
  • Get control over the bbcodes. You can enable/disable the processing of each bbcode.
  • Add new bbcode tags to your gallery (size, tt, hr, quote, youtube).
  • Add some buttons in the comment area for easy use of bbcodes. You can set who will see these buttons (nobody, admin only, everybody).
  • Show pre-built bbcode in file info. You can copy & paste the bbcode wherever you want.
  • Set maximum width/height of images via [img] tag.

A new button appears in the admin menu. There you can set everything related to bbcodes.

Download: http://sourceforge.net/projects/coppermine/files/Plugins/1.5.x/cpg1.5.x_plugin_bbcode_control_v1.9.zip/download

Thank you very much for this code. I don't know what to do with it. I've been using Coppermine for years (on someone else's server which is now dead) so have now installed it to my own website. My principal reason for installing it is as an "uploader" to post images on other forum sites. I thus want to be able to access BBCode for the individual (full size) images. I've searched extensively, and this seems to be the best option for me to enable that.

I was a programmer for many years, so can understand technical terms, but I've never been taught php or css, so don't know their particular attributes. I may be posting in the wrong place. If so, can you give me a link to the right one?

Hoping you can help me,

Geoff the Beard
Title: Re: BBCode Control (more bbcodes, buttons and adjustment) for cpg1.5.x
Post by: Αndré on September 15, 2011, 10:17:51 pm
I may be posting in the wrong place
Yes ;)
understand technical terms
BBCode is always processed on the target page, so for your purpose you don't need this plugin, as it won't change anything on the target pages. Actually this plugin adds a prepared BBCode to the gallery which you can easily copy to other pages. It's still a bonus feature of this plugin, but I plan to outsource it to an extra plugin (with some options). But that's already some months on my to-do list, so you shouldn't wait for that dedicated plugin 8)
Title: Re: BBCode Control (more bbcodes, buttons and adjustment) for cpg1.5.x
Post by: phill104 on September 16, 2011, 02:17:16 pm
Another option would be to use the Enlargit plugin as that has a bbcode button to generate code for pasting images and links. Unfortunately it currently has some minor problems with IE9 but I believe Timo is working on that.
Title: Re: BBCode Control (more bbcodes, buttons and adjustment) for cpg1.5.x
Post by: altenae on October 30, 2011, 04:04:22 pm
I have one issue with this plugin.

Some uploaded pictures don't have a intermediate size other have.

I have :

Thumbnail and the 1024px width picture
Thumbnail and the 1024px width picture and full size 1600px


When using this code (sse below) the normal returns an empty png file.
This is because there is a normal_ image when uploaded with 1600 width, but there is no normal_ image when uploaded with 1024 width, because in this case this is the full size one.


How can I solve this

 $url = $CONFIG['ecards_more_pic_target'].'displayimage.php?pid='.$CURRENT_PIC_DATA['pid'];

 $thumb = '(http://'.$CONFIG['ecards_more_pic_target'].get_pic_url($CURRENT_PIC_DATA, 'thumb').')';
 $normal = '(http://'.$CONFIG['ecards_more_pic_target'].get_pic_url($CURRENT_PIC_DATA, 'normal').')';



$info['BBCode full size'] = '<textarea onfocus="this.select();" onclick="this.select();" class="textinput" rows="1" cols="64" wrap="off" style="overflow:hidden; height:15px;">'.$full.' (http://'.$url.')</textarea>';

$info['BBCode thumb size'] = '<textarea onfocus="this.select();" onclick="this.select();" class="textinput" rows="1" cols="64" wrap="off" style="overflow:hidden; height:15px;">'.$normal.' (http://'.$url.'&normal)</textarea>';
Title: Re: BBCode Control (more bbcodes, buttons and adjustment) for cpg1.5.x
Post by: Αndré on November 03, 2011, 04:53:25 pm
I have one issue with this plugin.

Some uploaded pictures don't have a intermediate size other have.

I have :

Thumbnail and the 1024px width picture
Thumbnail and the 1024px width picture and full size 1600px


When using this code (sse below) the normal returns an empty png file.
This is because there is a normal_ image when uploaded with 1600 width, but there is no normal_ image when uploaded with 1024 width, because in this case this is the full size one.


How can I solve this

 $url = $CONFIG['ecards_more_pic_target'].'displayimage.php?pid='.$CURRENT_PIC_DATA['pid'];

 $thumb = '(http://'.$CONFIG['ecards_more_pic_target'].get_pic_url($CURRENT_PIC_DATA, 'thumb').')';
 $normal = '(http://'.$CONFIG['ecards_more_pic_target'].get_pic_url($CURRENT_PIC_DATA, 'normal').')';



$info['BBCode full size'] = '<textarea onfocus="this.select();" onclick="this.select();" class="textinput" rows="1" cols="64" wrap="off" style="overflow:hidden; height:15px;">'.$full.' (http://'.$url.')</textarea>';

$info['BBCode thumb size'] = '<textarea onfocus="this.select();" onclick="this.select();" class="textinput" rows="1" cols="64" wrap="off" style="overflow:hidden; height:15px;">'.$normal.' (http://'.$url.'&normal)</textarea>';

Double post (http://forum.coppermine-gallery.net/index.php/topic,73803.msg355511.html#msg355511) >:(

As this is no core functionality of this plugin, it won't be further discussed in this thread, but on the other one.
Title: Re: BBCode Control (more bbcodes, buttons and adjustment) for cpg1.5.x
Post by: Αndré on December 06, 2011, 04:32:38 pm
Version 1.10 attached to initial post.

Changelog:
Title: Re: BBCode Control (more bbcodes, buttons and adjustment) for cpg1.5.x
Post by: brad4edat on December 07, 2011, 11:14:33 pm
Hello all.

I want to use bbcode plugin from gallery to display 3D videos from youtube in the comments in my gallery.

bbcode plugin works very well, but only with the ordinary normal videos! 3D videos fail to run in 3D view.

Must change the code itself bbcode plugin.
Code: [Select]
// insert youtube video
    if (!in_array('youtube', $bbcode_tags_disabled)) {
        $youtube_embed_code_replacement  = "<object type=\"application/x-shockwave-flash\" width=\"640\" height=\"385\" data=\"http://www.youtube.com/v/\\2&hl=de&fs=1\">";
        $youtube_embed_code_replacement .= "<param name=\"movie\" value=\"http://www.youtube-nocookie.com/v/\\2&hl=de&fs=1\" />";
        $youtube_embed_code_replacement .= "<param name=\"allowfullscreen\" value=\"true\" />";
        $youtube_embed_code_replacement .= "</object>";
        $text = preg_replace("/\[youtube\].*(youtube\.com\/watch\?v=|youtu\.be\/)(.*)\[\/youtube\]/Usi", $youtube_embed_code_replacement, $text);
    }


The forum (phpp2) on my site also has bbcode plugin and everything is fine with the 3D view clips from youtube.
  Regularly with bbcode in the forum look like this:
Code: [Select]
<object width="420" height="315"><param name="movie" value="http://{TEXT1}youtube.com/v/{TEXT2}?version=3&amp;hl=bg_BG&amp;rel=0"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://{TEXT1}youtube.com/v/{TEXT2}?version=3&amp;hl=bg_BG&amp;rel=0" type="application/x-shockwave-flash" width="420" height="315" allowscriptaccess="always" allowfullscreen="true"></embed></object>

Can anyone tell me how to modify rows bbcode plugin, to work and 3D videos from youtube.
I think I have a very small correction, but do not understand programming languages ​​and I can not rewrite its own code.

Here's how it looks wrong when a 3D video in the comment to my gallery-
http://3d-universe.net/Gallery/displayimage.php?pid=1280&message_id=ee6da879373adf0f7fb22d4720c131de&message_icon=info#im=0

And here is how must to looks with right bbcode -
http://3d-universe.net/3d-forum/viewtopic.php?f=67&t=497
Title: Re: BBCode Control (more bbcodes, buttons and adjustment) for cpg1.5.x
Post by: Afonso on March 28, 2012, 12:18:15 am
Portuguese translation to BBcode_control plugin
In my site works good
Title: Re: BBCode Control (more bbcodes, buttons and adjustment) for cpg1.5.x
Post by: Αndré on March 28, 2012, 09:09:30 am
Thank you for your contribution. Portuguese language file added in SVN revision 8352.
Title: Re: BBCode Control (more bbcodes, buttons and adjustment) for cpg1.5.x
Post by: Afonso on April 25, 2012, 06:24:45 pm
Is possible insert the buttons of the BBCode plugin, in the area of description of the image ?[/font]
Image example
http://www.photoaves.com/img-ini/BBcode.jpg (http://www.photoaves.com/img-ini/BBcode.jpg)[/font]
Title: Re: BBCode Control (more bbcodes, buttons and adjustment) for cpg1.5.x
Post by: Αndré on April 25, 2012, 07:06:56 pm
You can use the new BBCodes everywhere where you're able to use the stock BBCodes.
Title: Re: BBCode Control (more bbcodes, buttons and adjustment) for cpg1.5.x
Post by: doppler on May 02, 2012, 12:50:08 pm
plugin is super! thank you

Is there possibility for add my own BBCode to the plugin? I have few which f.e. simply add link to another place of my page. I place a code in funciotns.php - but Andree sugested to use plugin instead of it.

f.e.
Code: [Select]
$text = str_replace("[mapa_nr]", '<a href=http://my_page/mapa/lista.php?numer=', $text);
$text = str_replace("[/mapa_nr]", ' >zlokalizuj na mapie</a>', $text);
Title: Re: BBCode Control (more bbcodes, buttons and adjustment) for cpg1.5.x
Post by: Αndré on May 02, 2012, 01:17:24 pm
Open codebase.php, find
Code: [Select]
return $text;and add your custom codes right above that line.
Title: Re: Re: BBCode Control (more bbcodes, buttons and adjustment) for cpg1.5.x
Post by: doppler on May 02, 2012, 02:06:15 pm
Open codebase.php, find
Code: [Select]
return $text;and add your custom codes right above that line.
working - very thank you again :)
one question more:
is the possibility tu show this in config list ? (I put my bbcodes in the list of "available tags" little below - and also add tag in language file - my bbcode was shown on the list - but bbcodes didn't work)
Title: Re: BBCode Control (more bbcodes, buttons and adjustment) for cpg1.5.x
Post by: Αndré on May 02, 2012, 02:32:42 pm
I assume you need to uninstall/install the plugin again after you applied your changes to insert required rows to the database.
Title: Re: BBCode Control (more bbcodes, buttons and adjustment) for cpg1.5.x
Post by: doppler on May 02, 2012, 02:55:48 pm
works!

In thank I add polish language translation
Title: Re: BBCode Control (more bbcodes, buttons and adjustment) for cpg1.5.x
Post by: Αndré on May 02, 2012, 03:12:39 pm
Added Polish language file in SVN revision 8388. Thank you for your contribution.
Title: Re: BBCode Control (more bbcodes, buttons and adjustment) for cpg1.5.x
Post by: hamgah on April 08, 2013, 08:02:30 am
And here is the Persian lang file.
Title: Re: BBCode Control (more bbcodes, buttons and adjustment) for cpg1.5.x
Post by: Αndré on April 09, 2013, 11:45:37 am
Added Persian language file in SVN revision 8547. Thank you for your contribution.
Title: Uncaught exception
Post by: Aziz108 on April 21, 2014, 05:13:28 pm
Hello! I don't know should I post this here or at forum plugin thread. I've installed forum plugin and bbcode control plugin. But bbcodes do not work with forum whenever I click their buttons - and I get this error in Opera and Chrome console:

Opera:
Quote
Uncaught exception: ReferenceError: Undefined variable: insert_bbcode_tag
Chrome:
Quote
Uncaught ReferenceError: insert_bbcode_tag is not defined

Every other instances of bbcode (photo comments, etc) work fine, only forum is affected. Seems as some JavaScripts are not included. Where should I include them and which one?

I have latest  cpg1.5.28. Please help.
Title: Re: BBCode Control (more bbcodes, buttons and adjustment) for cpg1.5.x
Post by: Tankertom on May 03, 2015, 07:48:52 pm
hi,
there is the possibility to implement mp3?
phpbbandbbcodes.com/viewtopic.php?f=14&t=433#.VUZcSkHc34Y (http://phpbbandbbcodes.com/viewtopic.php?f=14&t=433#.VUZcSkHc34Y)

VG TT
Title: Re: BBCode Control (more bbcodes, buttons and adjustment) for cpg1.5.x
Post by: Αndré on May 29, 2015, 08:50:43 pm
Should be quite easy, but I'd suggest to use the HTML5 "audio" tag instead of a Flash based solution: http://www.w3schools.com/html/html5_audio.asp
Title: Re: BBCode Control (more bbcodes, buttons and adjustment) for cpg1.5.x
Post by: Tankertom on June 02, 2015, 10:52:58 am
and how??
Title: Re: BBCode Control (more bbcodes, buttons and adjustment) for cpg1.5.x
Post by: Αndré on June 02, 2015, 09:04:30 pm
You need to add the tag at least to the available BBCode tags list and add a replacement code. You should also add a new language string to the plugin's language file(s) and you also add a new icon mp3.png. Here (and attached) is a patch proposal:
Code: [Select]
Index: codebase.php
===================================================================
--- codebase.php (revision 8783)
+++ codebase.php (working copy)
@@ -188,6 +188,10 @@
         $text = preg_replace("/\[youtube\].*(youtube\.com\/watch\?v=|youtu\.be\/)(.*)\[\/youtube\]/Usi", $youtube_embed_code_replacement, $text);
     }
 
+    if (!in_array('mp3', $bbcode_tags_disabled)) {
+        $text = preg_replace("/\[mp3](.*)\[\/mp3\]/Usi", "<audio controls><source src=\"\\1\" type=\"audio/mpeg\">Your browser does not support the audio element.</audio>", $text);
+    }
+
     // insert quote
     if (!in_array('quote', $bbcode_tags_disabled)) {
         $style = "style=\"background-image:url(plugins/bbcode_control/images/quote_show.png); background-repeat:no-repeat; background-position:top right; padding-right:40px;\"";
@@ -244,6 +248,7 @@
         'url', // cpg standard
         'img', // cpg standard
         'youtube',
+        'mp3',
         'pid', // cpg special for internal referencing
         'aid', // cpg special for internal referencing
         'cid', // cpg special for internal referencing
Index: lang/english.php
===================================================================
--- lang/english.php (revision 8783)
+++ lang/english.php (working copy)
@@ -44,6 +44,7 @@
 $lang_plugin_bbcode_control['size'] = 'Font size';
 $lang_plugin_bbcode_control['quote'] = 'Quote';
 $lang_plugin_bbcode_control['youtube'] = 'Youtube video';
+$lang_plugin_bbcode_control['mp3'] = 'MP3 audio file';
 $lang_plugin_bbcode_control['tt'] = 'Teletype';
 $lang_plugin_bbcode_control['hr'] = 'Horizontal rule';
 $lang_plugin_bbcode_control['pid'] = 'Picture in this gallery';


Maybe I'll add this to the next plugin version. If so, the tag's name will probably be "audio" and will support all supported HTML5 audio file types (mp3, ogg, wav).
Title: Re: Uncaught exception
Post by: Αndré on June 02, 2015, 09:47:32 pm
Hello! I don't know should I post this here or at forum plugin thread. I've installed forum plugin and bbcode control plugin. But bbcodes do not work with forum whenever I click their buttons - and I get this error in Opera and Chrome console:

Opera:Chrome:
Every other instances of bbcode (photo comments, etc) work fine, only forum is affected. Seems as some JavaScripts are not included. Where should I include them and which one?

I have latest  cpg1.5.28. Please help.

Works as expected for me (cpg1.5.36, BBCode control 1.10, Forum 2.1), regardless which plugin comes first in the plugin list. Have you installed any other plugins or mods to your gallery? Sorry for the late reply.
Title: Re: Re: BBCode Control (more bbcodes, buttons and adjustment) for cpg1.5.x
Post by: Αndré on June 03, 2015, 10:51:26 pm
Maybe I'll add this to the next plugin version. If so, the tag's name will probably be "audio" and will support all supported HTML5 audio file types (mp3, ogg, wav).

Added in version 1.11 (attached to initial post).
Title: Re: BBCode Control (more bbcodes, buttons and adjustment) for cpg1.5.x
Post by: pjhsGeorge on June 06, 2015, 06:34:38 pm
The BBCode does not show for editing Pictures Coppermine Gallery??  The plugin shows installed and I have the admin capability.  What did I miss?
Title: Re: BBCode Control (more bbcodes, buttons and adjustment) for cpg1.5.x
Post by: Αndré on June 09, 2015, 10:20:41 pm
The plugin has been created to display the buttons while adding/editing comments:
Code: [Select]
// bbcode buttons
$thisplugin->add_filter('theme_add_comment', 'buttons_add_comment');
$thisplugin->add_filter('theme_edit_comment', 'buttons_edit_comment');

If you want to display it elsewhere, the plugin needs to be modified accordingly.
Title: Re: BBCode Control (more bbcodes, buttons and adjustment) for cpg1.5.x
Post by: wilk on August 28, 2015, 10:30:01 pm
Polish translation for 1.11 (this is my private translation I've used on my gallery - now updated to 1.11, not updated doppler's one, it differs a bit).

I've also attached a patch for bug when index.php is redirected to /:

Code: [Select]
-echo "<form action=\"index.php?file=bbcode_control/admin\" method=\"post\">";
+echo '<form action="'.$superCage->server->getEscaped('REQUEST_URI').'" method="post">';
Title: Re: BBCode Control (more bbcodes, buttons and adjustment) for cpg1.5.x
Post by: Αndré on August 31, 2015, 04:11:02 pm
Updated and fixed in SVN revision 8807.
Title: Re: BBCode Control (more bbcodes, buttons and adjustment) for cpg1.5.x
Post by: twoclones on May 12, 2016, 09:23:14 pm
This plugin looks as if it could be 'enhanced' to allow using PayPal buttons in the description area.  I tried adding support for 'form' and 'input' to codebase.php but failed because the PayPal button code required type, name, value and the URL in the tags. 

I'd think someone more skilled than myself could make the plugin use the contents of the form and input tags.
Below is an example of a PayPal button in case someone would like to help. :)

<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top">
<input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="hosted_button_id" value="43DNKJHUDBB8G">
<input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_buynowCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
<img alt="" border="0" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" height="1">
</form>
Title: Re: BBCode Control (more bbcodes, buttons and adjustment) for cpg1.5.x
Post by: Αndré on May 12, 2016, 09:53:50 pm
If the button has always the same code, there's probably a better way to add that functionality than modifying this plugin. Please post more details.
Title: Re: BBCode Control (more bbcodes, buttons and adjustment) for cpg1.5.x
Post by: twoclones on May 13, 2016, 02:55:34 am
IF I always select the same options (which is fine for me), the only change to the button code is one of the input tags.  It's value changes with every new item and all of my items are unique.

This is the line that must have a different value every time.
Code: [Select]
<input type="hidden" name="hosted_button_id" value="VQBCE2PMJQPLL">
Title: Re: BBCode Control (more bbcodes, buttons and adjustment) for cpg1.5.x
Post by: twoclones on May 13, 2016, 06:54:06 pm
I figured out how to put a PayPal button in the file Description area without hacking the BBCode Control plugin ?  My instructions are at:
http://forum.coppermine-gallery.net/index.php/topic,78724.0.html (http://forum.coppermine-gallery.net/index.php/topic,78724.0.html)