Welcome to Geeklog, Anonymous Saturday, December 28 2024 @ 06:33 pm EST
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."
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."
8
11
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.
7
6
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:
// 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.
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.
8
7
Quote
All times are EST. The time is now 06:33 pm.
- 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