Advanced search  

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]

Pages: [1]   Go Down

Author Topic: bbcode in titles, some successful code changes, but still stuck.  (Read 5224 times)

0 Members and 1 Guest are viewing this topic.

spanishben

  • Coppermine newbie
  • Offline Offline
  • Posts: 7

I am trying to use bbcode in category, album, and photo titles. Currently it is only possible to use bbcode in descriptions, but I really need to use the bbcode function in titles too, mostly in order to use the multiple language hack mentioned here:
http://forum.coppermine-gallery.net/index.php?topic=2121.0

What I HAVE managed: I have managed to change the category and album titles on the index.php main index page, so that they accept bbcodes:

First change all instances of:

Code: [Select]
$alb_list[$alb_idx]['album_title'] = $alb_thumb['title'];

to

Code: [Select]
$alb_list[$alb_idx]['album_title'] = bb_decode($alb_thumb['title']);

that sorts out the album titles.

Next for the main category headings, change:

Code: [Select]
$subcat['name'] = $subcat['name']; on about line 128

to

Code: [Select]
$subcat['name'] = bb_decode($subcat['name']);
That sorts out all titles on the index page, both category and album titles now accept bbcodes.

On the displayimage.php image display page I have managed to get the picture title to work with bbcodes by changing:

Code: [Select]
'{TITLE}' => $CURRENT_PIC_DATA['title'],on about line 215

to

Code: [Select]
'{TITLE}' => bb_decode($CURRENT_PIC_DATA['title']),
BUT, what I HAVEN'T managed to do is change the album title or the picture titles on the thumnail.php page where you see all the thumnails for a given album. I have searched high and low both here and in the theme.php file for the theme I am using but to no avail...  I cannot find where to add the bb_decode in order to be able to see the bb codes properly used on this page.

Can anyone help with this last step?

Thanks

p.s. none of this effects the breadcrumbs which still do not render the bbcode correctly. But I imagine it is just a question of looking for where to add the bb-decode function. I have no need to use the breadcrumb at the moment, so haven't worked out if this is possible yet.
« Last Edit: October 14, 2004, 05:08:41 am by GauGau »
Logged

JasonB

  • Coppermine novice
  • *
  • Offline Offline
  • Gender: Male
  • Posts: 37
    • The Big Squiff
Re: bbcode in titles, some successful code changes, but still stuck.
« Reply #1 on: October 26, 2004, 08:13:59 pm »

First of all, thanks for posting what you did.  It's made my life easier.  I also have a need to have category titles (not descriptions) contain BBCode.  I want to be able to set up menus, where each menu item will (invisibly) either go to a sub-category or to an actual album.  But having all of the categories in one "block", and the albums in another - either above or below - destroys the "menu" concept.  (Because, then, list items not only fall out of alphabetical order but have completely different visual presentations.)  With your tweak, I can have a category title link directly to an album that's contained within the category - which gets around the "problem" of clicking on a category and then having to click on an album (with the same title) in order to get to the pictures that I'd like to get to from just the first click.

(It would be nice if Coppermine introduced "menu items" that could link to either a category or an album, or if an album could be set to display itself as if it were a category - but, without this, your solution is the best way of doing this.)

I still haven't figured out the breadcrumb display problem, but I do have a handle on getting the hyperlinks for category thugmbnails to link to the BBCode of the title, rather than to the category itself.  The problem is that, for some reason I really don't understand, Coppermine actually contains two set of hrefs, one for the thumbnail followed by one for the category title.  Since I've seen no indication that the thumbnail should ever take you somewhere different than the title, I really don't know why it was designed that way.  What needs to happen here is to have a single href that contains the thumbnail followed by the title.  The code for that is all already in place, it just needs to be tweaked a bit.

I'll be working on this tonight and hopefully post the "fix" then.  (Although, as I mentioned, I don't even have a clue yet about the breadcrumb problem.)
« Last Edit: October 26, 2004, 09:43:59 pm by JasonB »
Logged

JasonB

  • Coppermine novice
  • *
  • Offline Offline
  • Gender: Male
  • Posts: 37
    • The Big Squiff
Re: bbcode in titles, some successful code changes, but still stuck.
« Reply #2 on: October 27, 2004, 04:05:17 am »

Okay - I take it all back.  Or most of it anyway.

It's not nearly as simple as I'd thought.  The reason that there are two href entries (one for the image, the other for the title) is because of the way that the CSS is working - at least that seems to be part of it.  This isn't a big deal, but it does make things a bit more complicated.  Also, the very use of bb_decode() itself, causes a terminating (/a) as the (url) and (/url) are interpreted - so putting the picture in there (moving that bit of code) isn't effective.  I tried putting the picture link directly into the BBCode for the category title itself - (url)(img)(/img)Title(/url).  While this did, technically, work - the image was its full size, not the smaller size that's displayed via the CSS in use for it.  Since there's no BBCode way that I know of to apply stylesheets to the (img) tag (nor would the $image_size['geom'] that does the resizing be "portable" into the BBCode), it's not possible to resize it via a BBCode entry.

In short, things are too complicated for me to fight with.  It would mean some major rewriting of how things are done - not something I'm prepared to do.

The best I can come up with is to NOT use thumbnails for categories, NOT display albums at all, and have BBCode for category titles that link to the albums.  (Which isn't perfect, because I'd still like to, somehow, have a thumbnail for the category.  But then things go back to the original problem of the hyperlink being different for the thumbnail than they are for the title itself - so that's not acceptable.)
Logged

BMWHeaven

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 33
    • http://www.bmwheaven.com
Re: bbcode in titles, some successful code changes, but still stuck.
« Reply #3 on: November 10, 2004, 11:54:06 pm »

Life is lonely sometimes isn't it.....
I'll have a look as soon as I've got the time, but that could take a while..
Otherwise just mail or PM me, maybe I can help you?

Ilir

disismi

  • Coppermine newbie
  • Offline Offline
  • Posts: 7
Re: bbcode in titles, some successful code changes, but still stuck.
« Reply #4 on: January 14, 2005, 07:59:58 pm »

Any updates on this one? I would like to have this work correctly , but I can't figure this out. Anyone else?

Quote
BUT, what I HAVEN'T managed to do is change the album title or the picture titles on the thumnail.php page where you see all the thumnails for a given album. I have searched high and low both here and in the theme.php file for the theme I am using but to no avail...  I cannot find where to add the bb_decode in order to be able to see the bb codes properly used on this page.

Can anyone help with this last step?

Thanks

p.s. none of this effects the breadcrumbs which still do not render the bbcode correctly. But I imagine it is just a question of looking for where to add the bb-decode function. I have no need to use the breadcrumb at the moment, so haven't worked out if this is possible yet.
Logged
Pages: [1]   Go Up
 

Page created in 0.02 seconds with 22 queries.