BBCode Control (more bbcodes, buttons and adjustment) for cpg1.5.x - Page 2 BBCode Control (more bbcodes, buttons and adjustment) for cpg1.5.x - Page 2
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

BBCode Control (more bbcodes, buttons and adjustment) for cpg1.5.x

Started by Αndré, January 05, 2009, 02:14:00 PM

Previous topic - Next topic

0 Members and 4 Guests are viewing this topic.

Akuma2000

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)

Αndré

Quote from: Akuma2000 on October 15, 2010, 04:09:55 PM
it opens two new windows.
1x Gallery and 1x Picture fullsized
That's a feature of your board application.

In codebase.php, find
$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
$info['BBCode'] = '<textarea onfocus="this.select();" onclick="this.select();" class="textinput" rows="1" cols="64" wrap="off" style="overflow:hidden; height:15px;">'.$thumb.'</textarea>';


Akuma2000


lurkalot

Quote from: Αndré on October 15, 2010, 04:01:16 PM
In codebase.php, find
$thumb = '[img]'.$CONFIG['ecards_more_pic_target'].get_pic_url($CURRENT_PIC_DATA, 'thumb').'[/img]';
and replace with
$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).
Running SMF 2.1.4  / Tinyportal 3.0.1, bridged with Coppermine 1.6.25, plus cpmfetch 2.0.0

Αndré

Quote from: lurkalot on October 19, 2010, 10:04:57 AM
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
$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
$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?

lurkalot

Quote from: Αndré on November 01, 2010, 12:35:06 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,

QuoteParse error: syntax error, unexpected T_IF in /home/camxxxxx/public_html/gallery/plugins/bbcode_control/codebase.php on line 1
Running SMF 2.1.4  / Tinyportal 3.0.1, bridged with Coppermine 1.6.25, plus cpmfetch 2.0.0

Αndré

Quotecodebase.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.

lurkalot

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 ;)
Running SMF 2.1.4  / Tinyportal 3.0.1, bridged with Coppermine 1.6.25, plus cpmfetch 2.0.0

lurkalot

Forgot to add a screengrab to my last post.  Here it is for anyone who's interested.  ;)
Running SMF 2.1.4  / Tinyportal 3.0.1, bridged with Coppermine 1.6.25, plus cpmfetch 2.0.0

hanzon2010

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 ...

Αndré

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.

hanzon2010

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.

Αndré


hanzon2010

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).

hanzon2010

Sorry, I just realized the items in between "[]" have not been shown, please ignore above, will post a screen capture version instead.

hanzon2010


hanzon2010

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)


André Müller

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

cavok

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.
Coppermine 1.5.22 hosting by Free

Αndré

That should be possible, but I think I won't implement it in the near future, as I'm too busy. Sorry.