Welcome to Geeklog, Anonymous Wednesday, April 24 2024 @ 10:28 am EDT

Geeklog Forums

Centering an image using variable


Status: offline

head-explody

Forum User
Newbie
Registered: 08/18/06
Posts: 1
As you all know, when linking an image in a story there are [imageX_left], [imageX_right], et cetera. I want to add an [imageX_center] if possible. Is there any way to do this?

I understand that I could create a CSS value for it, but I think it would be easier just to create a value to go with the other alignments.
"And if it's a lie... Terrorists made me say it."
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
Text Formatted Code
<p align="center">[image1]</p>
 

bye, Dirk
 Quote

head-explody

Anonymous
Thanks, but... That's not what I meant. I know how to center an image, I just wanted to know how to code the tag [imageX_center], because it would make it that much easier when it comes to posting.
 Quote

Status: offline

jmucchiello

Forum User
Full Member
Registered: 08/29/05
Posts: 985
Look in /pathtogeeklog/system/lib-story.php. Should just be a couple copy and edit lines:

Text Formatted Code

// add after line 719
        $imageX_center = '[image' . $i . '_center]';

// add after line 757 and 778
        $center = "<p align=center>$norm</p>";

// add after line 765
        $intro = str_replace ($center, $imageX_center, $intro);
        $body  = str_replace ($center, $imageX_center, $body);

// add after line 773
            $unscaledX_right = '[unscaled' . $i . '_right]';

// add after line 785
            $intro = str_replace ($center, $unscaledX_center, $intro);
            $body  = str_replace ($center, $unscaledX_center, $body);

 

And you probably need to update the languages/*.php files, modifying $LANG24[51] to include "imageX_center" in the description.
 Quote

All times are EDT. The time is now 10:28 am.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content