PDA

View Full Version : Multiple TXT Boxes II Updated


Dkozikowski
04-23-2006, 10:23 AM
Installation instructions for 'Text Box MOD' Version 1.0.2
(Updated for Pixelpost version 1.5 RC1)

About this MOD:

Title:
Text Box MOD

Description:
Adds a new form field in new_image.php allowing you to enter the photographs location at time of upload.
You can also edit and add locations to previous photographs via images_edit.php

Version:
1.0.2

Installation Level:
Moderate

Installation Time:
20 minutes

Author

Username:
dwilkinsjr

Realname:
David Wilkins Jr

WWW:
http://dwilkinsjr.com

Files To Edit:

index.php,
admin/images_edit.php,
admin/new_image.php,
language/admin-lang-english.php,
language/lang-english.php

Included Files:

install.php

Disclaimer:

!!!!INSTALL AT YOUR OWN RISK!!!!

FYI, Downloading this MOD from other sites could cause malicious code to enter into your pixelpost installation.

Author Notes:

This MOD is copyright 2005-2006 David Wilkins, All Rights Reserved
Be sure to edit all templates you have loaded.
Do not save any file until all procedures have been completed.

Once all the below modifications have been completed and saved,
open the included install.php which should have been coppied to your pixelpost directory and
follow the instructions within.

MOD History:

2006-02-24 - Version 1.0.0
First release.
2006-02-11 - Version 1.0.1
Added more language file support.
2006-04-23 - Version 1.0.2
Updated to work with pixelpost 1.5 RC1

Other Notes:

Before attempting this MOD to your Pixelpost instalation, You should back up all files related to this MOD.

This MOD was designed for Pixelpost 1.5 RC1 and may not function as stated on other Pixelpost versions.

File Copy:

Copy: install.php
To: pixelpost_root/install.php

Edits:

These are manual instructions that cannot be performed automatically. You should follow these instructions carefully.

Open: index.php

Find:

$image_title = htmlspecialchars($image_title,ENT_QUOTES);

Add after:

$image_location = $lang_location . pullout($row['location']);

Find:

$tpl = ereg_replace("<IMAGE_TITLE>",$image_title,$tpl);

Add after:

$tpl = ereg_replace("<IMAGE_LOCATION>",$image_location,$tpl);



Open: admin/images_edit.php

Find:

$headline = clean($_POST['headline']);

Add after:

$location = clean($_POST['location']);

Find:

$query = "update ".$pixelpost_db_prefix."pixelpost set datetime='$newdatetime', headline='$headline', body='$body', category='$category' where id='$getid'";

In-line Find:

headline='$headline',

In-line Add after:

location='$location',

Find:

while(list($id,$datetime,$headline,$body,$image,$c ategory) = mysql_fetch_row($images)) {

In-line Find:

$headline,

In-line Add after:

$location,

Find:

# $headline = htmlentities($headline);

Add after:

$location = pullout($location);

Find:

#$id, $admin_lang_imgedit_title $headline,

Add after:

$admin_lang_imgedit_location $location,

Find:

$headline = htmlspecialchars($headline,ENT_QUOTES);

Add after:

$location = pullout($imagerow['location']);

Find:

<div class='jcaption'>$admin_lang_imgedit_title</div>
<div class='content'>
<input type='text' name='headline' value='$headline' style='width:300px;' />
</div>

Add after:

<div class='jcaption'>$admin_lang_imgedit_location</div>
<div class='content'>
<input type='text' name='location' value='$location' style='width:272px;' />
</div>



Open: admin/new_image.php

Find:

<input type="text" name="headline" style="width:450px;" /><p />

Add after:

<?php echo $admin_lang_ni_image_location; ?>&nbsp;&nbsp;&nbsp;
<input type="text" name="location" style="width:428px;" /><p />

Find:

$headline = clean($_POST['headline']);

Add after:

$location = clean($_POST['location']);

Find:

$query = "insert into ".$pixelpost_db_prefix."pixelpost(datetime,headline,body,image)

In-line Find:

headline,

In-line Add after:

location,

Find:

VALUES('$datetime','$headline','$body','$image')";

In-line Find:

'$headline',

In-line Add after:

'$location',



Open: language/admin-lang-english.php

Find:

$admin_lang_ni_image_title = "Image Title";

Add after:

$admin_lang_ni_image_location = "Image Location";

Find:

$admin_lang_imgedit_title = "Title:";

Add after:

$admin_lang_imgedit_location = "Location:";



Open: language/lang-english.php

Find:

$lang_message_banned_comment = "Your comment hasn't been saved! It contains one or more banned words/email/ips.";

Add after:

// Extra Information
$lang_location = "Location: ";


Additional Notes:

All my "hacks" follow phpBB forum MOD guidelines. If you need more guidance in following this hack, please check out phpBB's article on How to install a MOD (http://www.phpbb.com/kb/article.php?article_id=150). Please note that this article should be used as a guideline as to what each "command" means. e.g.- If you don't know what the following means; Find, After Add, In-line Find, In-line After add, etc. The above referenced link will explain it to you.

Also, I have created a online version coded in XML. It is much easier to follow but you will need an XML viewer to see the file. I testing it out using the latest versions of Apple Safari and Firefox on my MAC and all looked well. However, I was not able to test it on a Microsoft Windows machine using its supported browsers.

'Text Box MOD' Version 1.0.2 MODX.xml (http://dwilkinsjr.com/public/mods/txtbox/txtbox_mod.xml)

Download Installer File (http://dwilkinsjr.com/public/mods/txtbox/txtbox102.zip)
(Installer file is needed to make the necessary changes to your database)

Joe[y]
04-23-2006, 10:52 AM
this would be more than easy to turn into an addon.

RobbieMc
04-23-2006, 01:58 PM
Are there instructions somewhere on how to create an admin addon?

I would also like to make my language switch hack into an addon, but I don't know how to make the new language text boxes appear on the new image page, something I wish to do, just as I imagine David does as well. I don't want to have to switch over to a new page in the admin to enter the alternative language text.

Looks great, btw David.

Rob

Connie
04-23-2006, 04:20 PM
Are there instructions somewhere on how to create an admin addon?

RTFM ;=)

there is really documentation: doc\creating_admin_addons

living in a world of blinds ... who by some strange fate are photographers ;=)

Dkozikowski
04-23-2006, 06:18 PM
']this would be more than easy to turn into an addon.

Get it done!

I "hack" code. When it comes to real programming, I don't know a thing and I'm not ashamed to admit it :p

RobbieMc
04-24-2006, 10:18 PM
Thanks for the tip, Connie.

But really, this:

RTFM ;=)

there is really documentation: doc\creating_admin_addons

living in a world of blinds ... who by some strange fate are photographers ;=)

Could just as easily been simply this:

there is documentation: doc\creating_admin_addons

and the good karma of this forum would have been preserved.

apw
04-25-2006, 09:43 AM
Firstly, many thanks for doing this David.

I have tried the install and have had more success than last time. However, I have received the following error in the admin screen:

Parse error: syntax error, unexpected T_VARIABLE in /home/XXXX/public_html/admin/options.php on line 133

Any ideas on what has occurred?

Dkozikowski
04-25-2006, 10:03 AM
Im not sure why options.php is having an error b/c we did not edit it!

I have had many problems copying code from this forum! It seems to copy fine and paste fine, but hidden in all the spaces are weird characters that you don't see. so either enter all the code manually or go back and backspace all the spaces in the code and manually input the space again. did this make sense? anyone else know what I'm talking about?

blinking8s
04-25-2006, 10:52 AM
the code, html and php tags shouldnt mess this up, its part of the reasons we switched forum scripts...humm

Dkozikowski
04-25-2006, 10:55 AM
the code, html and php tags shouldnt mess this up, its part of the reasons we switched forum scripts...humm


So you know what I have been encountering!?! What a pain in the @ss! Myabe its my setup? Latest version of OSX 10.4.6, using latest version of Safari, pasting to the latest version of BBEdit. Who knows, but BBEdit does not like when I copy and paste code from this forum!

pood
12-07-2006, 05:27 PM
anyone finish the addon?

Dennis
12-13-2006, 04:43 PM
klimin_a_s is working on something similar, I made some suggestions for the code but it will come soon.

Dennis
12-18-2006, 06:04 PM
klimin_a_s released his version. read about it here (http://forum.pixelpost.org/showthread.php?t=5780).

This is a better solution since it does not require any hacking of the core files.

Dkozikowski
12-18-2006, 06:09 PM
klimin_a_s released his version. read about it here (http://forum.pixelpost.org/showthread.php?t=5780).

This is a better solution since it does not require any hacking of the core files.

Yeah, I already saw, downloaded, and tested. :)