Pixelpost Forum

Pixelpost Forum (http://www.pixelpost.org/forum/index.php)
-   Hacks and Modifications (http://www.pixelpost.org/forum/forumdisplay.php?f=16)
-   -   Multiple TXT Boxes II Updated (http://www.pixelpost.org/forum/showthread.php?t=3946)

Dkozikowski 04-23-2006 10:23 AM

Multiple TXT Boxes II Updated
 
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:
PHP Code:

    $image_title htmlspecialchars($image_title,ENT_QUOTES); 

Add after:
PHP Code:

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

Find:
PHP Code:

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

Add after:
PHP Code:

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


Open: admin/images_edit.php

Find:
PHP Code:

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

Add after:
PHP Code:

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

Find:
PHP Code:

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

In-line Find:
PHP Code:

headline='$headline'

In-line Add after:
PHP Code:

 location='$location'

Find:
PHP Code:

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

In-line Find:
PHP Code:

$headline

In-line Add after:
PHP Code:

$location

Find:
PHP Code:

#                  $headline = htmlentities($headline); 

Add after:
PHP Code:

                    $location pullout($location); 

Find:
PHP Code:

                #$id, $admin_lang_imgedit_title $headline, 

Add after:
PHP Code:

                $admin_lang_imgedit_location    $location

Find:
PHP Code:

      $headline htmlspecialchars($headline,ENT_QUOTES); 

Add after:
PHP Code:

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

Find:
HTML Code:

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

Add after:
HTML Code:

                        <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:
HTML Code:

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

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

Find:
PHP Code:

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

Add after:
PHP Code:

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

Find:
PHP Code:

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

In-line Find:
PHP Code:

headline

In-line Add after:
PHP Code:

location

Find:
PHP Code:

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

In-line Find:
PHP Code:

'$headline'

In-line Add after:
PHP Code:

'$location'


Open: language/admin-lang-english.php

Find:
PHP Code:

$admin_lang_ni_image_title        "Image Title"

Add after:
PHP Code:

$admin_lang_ni_image_location     "Image Location"

Find:
PHP Code:

$admin_lang_imgedit_title          "Title:"

Add after:
PHP Code:

$admin_lang_imgedit_location       "Location:"


Open: language/lang-english.php

Find:
PHP Code:

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

Add after:
PHP Code:

// 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. 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

Download Installer File
(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

Quote:

Originally Posted by RobbieMc
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

Quote:

Originally Posted by Joe[y]
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:

Quote:

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:

Quote:

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

Quote:

Originally Posted by blinking8s
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!


All times are GMT. The time now is 03:56 AM.

Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.