News:

CPG Release 1.6.28
added submissions from {406man}
cleaned up a few PHP (8.4) deprecations
fixed PHP deprecation in calendar
removed security vulnerability
(please upgrade when possible)

Main Menu

requests

Started by danp, October 05, 2003, 07:58:01 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

danp

Two requests, I'd like to be able to use html in the picture's title and description so I could have a link under the picture.  And when someone isn't logged in and they try to access the gallery it gives some weird error like, "can't get to database", make it say something like "sorry you must login to view this album".

Joachim Müller

usage of html in titles is definitely a no-no, since coppermine is supposed to be a gallery where not only you (the site admin) can post, but also your users; allowing html code would be a huge security risk.
Instead, use ubbc (the same stuff used here on this board to create links) - see online doc.

Your second issue isn't actually a feature request, but is caused by some misconfiguration (either in your coppermine install or your server). Re-post it as support request with a link and as many information as necessary (actually quote the error message with copy and paste!) on the proper support board for the version of coppermine you're using.
Be sure to read the faq and manual before you post, and be sure to search the board first for an answer.

GauGau

danp

I can't get the bbcode to work, here is one of the links I made in an image's description.

[url=http://www.beautyanalysis.com/]Beaury Analysis[/url]

Here is the link to the album, but you have to register for free first.

http://www.correct-proportion.com/modules.php?name=coppermine&file=thumbnails&album=1

The docs say that it supports bbcode in the album and image descriptions, being able to put it in the image's title would be nice.

Joachim Müller

You can't expect a supporter to bother with registration first - next time you ask for support provide an account in your posting as well :evil: .
That's why I didn't check on your gallery!
To enable ubbc in custom fields, make sure to read http://coppermine.sourceforge.net/faq.php?q=linksInCustomFields#linksInCustomFields

I'll move this to support - since you're running a phpnuke version I can't be bothered anyway - that's not my line of work... :wink:

GauGau

P.S. read How to ask a question on support

danp

bbcode isn't working in the images' descriptions or titles, I did the thing you said but that is for custom fields which I'm not using.

http://www.correct-proportion.com/modules.php?name=coppermine&file=thumbnails&album=1

user: nimrod
pass:guitar

Has nothing to do with phpnuke, help, please!  :wink:

danp


kegobeer

Do not send me a private message unless I ask for one.  Make your post public so everyone can benefit.

There are no stupid questions
But there are a LOT of inquisitive idiots

danp

I installed coppermine by itself, not in nuke and bbcode does not work.  Is it supposed to, does it work for anyone else?

danp

Whats up with my bbcode?

(https://coppermine-gallery.com/forum/proxy.php?request=http%3A%2F%2Fwww.correct-proportion.com%2Ftemp%2FbbcodeError.jpg&hash=5981c5f1467a7347ebdd1c100415a9a226098170)

Can't really read it in the pic, but what it says is...
[url=http://www.beautyanalysis.com]Beauty Analysis[/url]

This is supposed to work right?

kegobeer

I couldn't get it working either.  After looking at the code, I made a fix.  In functions.inc.php, replace the entire function bb_decode($text) with:

function bb_decode($text)
{
        $text = " " . $text;

        static $bbcode_tpl = array();
        static $patterns = array();
        static $replacements = array();

        // First: If there isn't a "[" and a "]" in the message, don't bother.
        if (! (strpos($text, "[") && strpos($text, "]")) )
        {
                return $text;
        }

        // [b] and [/b] for bolding text.
        $text = str_replace("[b]", '<b>', $text);
        $text = str_replace("[/b]", '</b>', $text);

        // [u] and [/u] for underlining text.
        $text = str_replace("[u]", '<u>', $text);
        $text = str_replace("[/u]", '</u>', $text);

        // [i] and [/i] for italicizing text.
        $text = str_replace("[i]", '<i>', $text);
        $text = str_replace("[/i]", '</i>', $text);

        //if (!count($bbcode_tpl)) {
                // We do URLs in several different ways..
                $bbcode_tpl['url']  = '<span class="bblink"><a href="{URL}" target="_blank">{DESCRIPTION}</a></span>';
                $bbcode_tpl['email']= '<span class="bblink"><a href="mailto:{EMAIL}">{EMAIL}</a></span>';
               
                $bbcode_tpl['url1'] = str_replace('{URL}', '\\1\\2', $bbcode_tpl['url']);
                $bbcode_tpl['url1'] = str_replace('{DESCRIPTION}', '\\1\\2', $bbcode_tpl['url1']);

                $bbcode_tpl['url2'] = str_replace('{URL}', 'http://\\1', $bbcode_tpl['url']);
                $bbcode_tpl['url2'] = str_replace('{DESCRIPTION}', '\\1', $bbcode_tpl['url2']);

                $bbcode_tpl['url3'] = str_replace('{URL}', '\\1\\2', $bbcode_tpl['url']);
                $bbcode_tpl['url3'] = str_replace('{DESCRIPTION}', '\\3', $bbcode_tpl['url3']);

                $bbcode_tpl['url4'] = str_replace('{URL}', 'http://\\1', $bbcode_tpl['url']);
                $bbcode_tpl['url4'] = str_replace('{DESCRIPTION}', '\\2', $bbcode_tpl['url4']);

                $bbcode_tpl['email'] = str_replace('{EMAIL}', '\\1', $bbcode_tpl['email']);

                // [url]xxxx://www.phpbb.com[/url] code..
                $patterns[] = "#\[url\]([a-z]+?://){1}([a-z0-9\-\.,\?!%\*_\#:;~\\&$@\/=\+\(\)]+)\[/url\]#si";
                $replacements[] = $bbcode_tpl['url1'];

                // [url]www.phpbb.com[/url] code.. (no xxxx:// prefix).
                $patterns[] = "#\[url\]([a-z0-9\-\.,\?!%\*_\#:;~\\&$@\/=\+\(\)]+)\[/url\]#si";
                $replacements[] = $bbcode_tpl['url2'];

                // [url=xxxx://www.phpbb.com]phpBB[/url] code..
                $patterns[] = "#\[url=([a-z]+?://){1}([a-z0-9\-\.,\?!%\*_\#:;~\\&$@\/=\+\(\)]+)\](.*?)\[/url\]#si";
                $replacements[] = $bbcode_tpl['url3'];

                // [url=www.phpbb.com]phpBB[/url] code.. (no xxxx:// prefix).
                $patterns[] = "#\[url=([a-z0-9\-\.,\?!%\*_\#:;~\\&$@\/=\+\(\)]+)\](.*?)\[/url\]#si";
                $replacements[] = $bbcode_tpl['url4'];

                // [email]user@domain.tld[/email] code..
                $patterns[] = "#\[email\]([a-z0-9\-_.]+?@[\w\-]+\.([\w\-\.]+\.)?[\w]+)\[/email\]#si";
                $replacements[] = $bbcode_tpl['email'];
        //}

        $text = preg_replace($patterns, $replacements, $text);

        return $text;
}


Should do the trick.
Do not send me a private message unless I ask for one.  Make your post public so everyone can benefit.

There are no stupid questions
But there are a LOT of inquisitive idiots

kegobeer

Remember, only the description field is decoded, not the title!
Do not send me a private message unless I ask for one.  Make your post public so everyone can benefit.

There are no stupid questions
But there are a LOT of inquisitive idiots

danp

Thanks, I'll try it tonight.

I just saw that your from panama city!!! I grew up there, just moved from there to seattle.  Small world.

kegobeer

Been on the beach for about 2 years now.  Pretty nice place.  PC is finally getting a Best Buy, and the beach is getting a Home Depot.  They'll join the 21st century sooner or later.  :lol:
Do not send me a private message unless I ask for one.  Make your post public so everyone can benefit.

There are no stupid questions
But there are a LOT of inquisitive idiots