coppermine-gallery.com/forum

Support => Older/other versions => cpg1.1d PHPnuke Support (deprecated) => Topic started by: danp on October 05, 2003, 07:58:01 PM

Title: requests
Post by: danp on October 05, 2003, 07:58:01 PM
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".
Title: requests
Post by: Joachim Müller on October 05, 2003, 10:46:14 PM
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 (http://coppermine.sourceforge.net/manual.php#album_prop).

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
Title: requests
Post by: danp on October 06, 2003, 07:06:56 AM
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.
Title: requests
Post by: Joachim Müller on October 06, 2003, 09:11:40 AM
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 (http://coppermine.sourceforge.net/faq.php?q=howtoask#howtoask)
Title: requests
Post by: danp on October 07, 2003, 08:16:57 AM
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:
Title: requests
Post by: danp on October 07, 2003, 06:57:12 PM
bump
Title: requests
Post by: kegobeer on October 08, 2003, 02:09:53 AM
http://coppermine.sourceforge.net/faq.php?q=lamesupport#lamesupport
Title: requests
Post by: danp on October 11, 2003, 02:27:58 AM
I installed coppermine by itself, not in nuke and bbcode does not work.  Is it supposed to, does it work for anyone else?
Title: requests
Post by: danp on October 14, 2003, 12:32:36 AM
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?
Title: requests
Post by: kegobeer on October 14, 2003, 01:39:22 AM
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.
Title: requests
Post by: kegobeer on October 14, 2003, 02:04:13 AM
Remember, only the description field is decoded, not the title!
Title: requests
Post by: danp on October 14, 2003, 02:53:58 AM
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.
Title: requests
Post by: kegobeer on October 14, 2003, 02:55:36 AM
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: