Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - Chris

Pages: [1] 2 3 4 5
1
Mods & Plugins (Releases & Support) / [MOD] RSS Feed 0.1
« on: June 04, 2005, 01:06:09 AM »
Originally posted by falti.  This is being restored from saved search engine cache pages

Installation:
1. Open rss.php and modify CONFIG values.
2. Upload rss.php to 4images root directory. Upload rss.html and rssitem.html to your template directory (i.e. templates/yourtemplate/).
3. Modify your template that user have a link to rss.php. Or simply upload the modified footer.html to your templates folder.

Notes:
Currently there is no check if a user is allowed to view an image presented via rss. This is due to the fact, that a user reading the rss feed is not logged in to the 4images system. If you find a solution for this problem feel free to modify the script and let me know how you made it.
If most of your categories are open for unregistered users then you can use a sql statement similar to index.php.

2
In admin/settings.php, the anchors are incorrectly coded with a "#" preceeding the anchor target name,
Code: [Select]
<a name="#setting_group_1">... HTML ...</a>
It really should be:
Code: [Select]
<a name="setting_group_1">... HTML ...</a>The named target anchor should be without the "#" character, whereas the JUMP to the local target anchor does require the "#" character:
Code: [Select]
<a href="#setting_group_1">
As an anchor, the code between the <a name="TheAnchorName"> and </a> is meaningless and has no bearing on the anchor. What is required is the complete anchor with the closing tag. <a name="TheAnchorName"></a>

When the anchor is coded with the "#", the problem is not apparent in IE (lax interpretation of HTML); BUT it is apparent in other browsers such as Netscape and Mozilla. In Netscape and Mozilla, there is NO local target anchor if it is incorrectly defined using a "#" as in
Code: [Select]
<a name="#TheAnchorName"></a>

To fix these text links, open admin/settings.php and locate these lines:
Code: [Select]
  show_table_separator($setting_group[1], 2, "#setting_group_1");
  show_table_separator($setting_group[2], 2, "#setting_group_2");
  show_table_separator($setting_group[3], 2, "#setting_group_3");
  show_table_separator($setting_group[4], 2, "#setting_group_4");
  show_table_separator($setting_group[5], 2, "#setting_group_5");
  show_table_separator($setting_group[6], 2, "#setting_group_6");
  show_table_separator($setting_group[7], 2, "#setting_group_7");
and simply remove the # character

Credit goes to twmm for posting the issue: http://www.4homepages.de/forum/index.php?topic=3300.0

3
SUMMARY

When selecting a new value for "Images Per Page", the value is only stored for the current session. If you close your browser and then open it again to the 4images site, the value you previously selected is forgotten. Only the default setting from the admin control panel is used.

This mod stores the value the user selects in a cookie so that on subsequent visits the "Images Per Page" is restored to the previously chosen setting.

COMMENTS

I chose to use a cookie and not make this part of the user's control panel for a simple reason. Many users, including me, access the same 4images web site from different computers and using monitors with different resolutions. A cookie lets me customize the "Images Per Page" to each monitor.

INSTRUCTIONS

Open includes/page_header.php and locate this block of code:
Code: [Select]

//-----------------------------------------------------
//--- Set Paging Vars ---------------------------------
//-----------------------------------------------------
if (isset($HTTP_POST_VARS['setperpage'])) {
  $setperpage = intval($HTTP_POST_VARS['setperpage']);
  if ($setperpage) {
    $site_sess->set_session_var("perpage", $setperpage);
    $session_info['perpage'] = $setperpage;
  }
}

if (isset($session_info['perpage'])) {
  $perpage = $session_info['perpage'];
}
else {
  $perpage = ceil($config['default_image_rows'] * $config['image_cells']);
}


REPLACE it with this block:
Code: [Select]

//-----------------------------------------------------
//--- Set Paging Vars ---------------------------------
//-----------------------------------------------------
if (isset($HTTP_POST_VARS['setperpage'])) {
  $setperpage = intval($HTTP_POST_VARS['setperpage']);
  if ($setperpage) {
    $site_sess->set_session_var("perpage", $setperpage);
    $session_info['perpage'] = $setperpage;
    $site_sess->set_cookie_data("perpage", $setperpage);
  }
}

if (isset($session_info['perpage'])) {
  $perpage = $session_info['perpage'];
}
else if($site_sess->read_cookie_data("perpage")) {
  $perpage = $site_sess->read_cookie_data("perpage");
  $site_sess->set_session_var("perpage", $perpage);
  $session_info['perpage'] = $perpage;
}
else {
  $perpage = ceil($config['default_image_rows'] * $config['image_cells']);
  $site_sess->set_cookie_data("perpage", $perpage);
}


That's it. Enjoy!

If you would also like to make the "Images Per Page" a jump menu, please see this post: http://www.4homepages.de/forum/index.php?topic=3815.0

4
FAQ, Tips / Do NOT send unsolicited PMs to Admins/Moderators
« on: April 26, 2005, 03:15:01 PM »
Please do NOT send PMs (Private Messages) with just 4 words: "Can you help me" and a link to the post where you already asked a question. This is just annoying and unpolite.

Many people on this forum (definitely moderators/administrators) are reading every new post since their last visit, and if nobody replied to your question, that doesnt mean they didnt read it, it just means they dont have an answer!

Always start by posting in the forum.  You will get the best chance for assistance that way.

Thank you.

P.S.:  You can expect any such PMs sent to moderators/administrators to be deleted WITHOUT being read.

5
Français / Forum Moderator Needed
« on: April 26, 2005, 02:23:02 AM »
Before the forum was hacked, we used to have a French forum.  I have recreated the board but we now need someone who speaks French to volunteer to be a moderator.  If interested, simply reply to this topic and an administrator will contact you.



modifing test

6
details.html is the template that displays image details along with the image itself (via one of the media templates)

By default, the details.html template uses text links for navigating to the next and previous images. Some people would prefer to also show the thumbnails of those images.

In the details.html template that ships with the downloaded distribution of 4images, there is the following code:
Code: [Select]
<table width="100%" border="0" cellspacing="0" cellpadding="3">
  <tr valign="top">
    <td class="row2">
      {if prev_image_name}{lang_prev_image}<br />
      <b><a href="{prev_image_url}">{prev_image_name}</a></b>

      <!-- <br /><br /><a href="{prev_image_url}"><img src="{prev_thumb_file}" border="1"></a> -->

      {endif prev_image_name}&nbsp;</td>
    <td align="right" class="row2">
      &nbsp;{if next_image_name}{lang_next_image}<br />
      <b><a href="{next_image_url}">{next_image_name}</a></b>

      <!-- <br /><br /><a href="{next_image_url}"><img src="{next_thumb_file}" border="1"></a> -->

      {endif next_image_name}</td>
  </tr>
</table>
As you can see above, there is already HTML code that can display the thumbnails. It is simply commented out. To activate the thumbnails, uncomment the thumbnail HTML links:
Code: [Select]
<table width="100%" border="0" cellspacing="0" cellpadding="3">
  <tr valign="top">
    <td class="row2">
      {if prev_image_name}{lang_prev_image}<br />
      <b><a href="{prev_image_url}">{prev_image_name}</a></b>

      <br /><br /><a href="{prev_image_url}"><img src="{prev_thumb_file}" border="1"></a>

      {endif prev_image_name}&nbsp;</td>
    <td align="right" class="row2">
      &nbsp;{if next_image_name}{lang_next_image}<br />
      <b><a href="{next_image_url}">{next_image_name}</a></b>

      <br /><br /><a href="{next_image_url}"><img src="{next_thumb_file}" border="1"></a>

      {endif next_image_name}</td>
  </tr>
</table>

7
Hello all
I had so much trouble installing this program that I started to keep notes. I think I installed and removed it 16 times before I finally got it to install properly. So I decided to share my notes on this forum for anybody else to use. This is what I had to do to install this script, if it doesn’t work for you I’m sorry, no guarantees. If this post is helpful to you I would appreciate a simple thanks. I would like any input on improving these instructions, just post below and I will try to incorporate the improvements.
Hopefully the moderators will pin this post up high and allow me to keep on editing and improving this post for all to use.

I will use some abbreviations, YC = Your Computer that you are sitting in front of, YW = Your Website.

1) Create a temp folder on YC, for this example I will use C:\1\

2) Download 4images1.7.zip from http://www.4homepages.de/4images/download.php and place in C:\1\ on YC

3) Download language-pack_english.zip from http://www.4homepages.de/4images/download.php and place in C:\1\ on YC

4) Unzip both 4images1.7.zip and language-pack_english.zip in C:\1\ on YC, you should get some folders below C:\1\ on YC if the files unzipped properly.

5) Copy the folder english and its contents from C:\1\language-pack_english\english on YC to C:\1\4images\lang\english (this is how it should look when you are done) on YC.

6) Delete the files lightbox_no.gif lightbox_off.gif lightbox_yes.gif profile.gif on YC from the folder C:\1\4images\templates\default\images, copy the files with the same name from your C:\1\language-pack_english\images_english folder on YC into the C:\1\4images\templates\default\images folder.

7) Delete the four files update_*_to_*.php from C:\1\4images these can corrupt your site later if they are executed.

8) This is optional; delete all the files from within C:\1\4images\docs on YC to save space. There are some instilation instructions in this folder that were incorporated into this post.

9) Ask your website host to disable SAFE MODE from what I understand it is a php function and it may keep your users from being able to upload images.

10) Go into your website control panel and create a new database in MySQL you will give it a name like 4images it will end up looking like MyWebControlUserName_4images and a database user name it will end up looking like MyWebControlUserName_MyDatabaseUserName and a password I will use MyDatabasePassword for this example.

11) You will need an FTP program for much of the following modifications I like SmartFTP http://www.smartftp.com/ they offer a 30 day free trial.

12) Copy the 4images folder and all its contents from your YC into the root folder of your YW it will end up looking like www.example.com/4images/ . . . or it may look like www.example.com/public_html/4images/ . . . depending on your FTP program.

13) Open a browser on YC like Microsoft’s Internet Explorer and enter “http://www.example.com/4images/install.php?install_lang=english”.

14) You should end up in a window that asks for the following information. Fill out the fields exactly as shown. I’m showing you the format I had to enter to get it to install. A small mistake here will screw things up; at least it did for me. Ignore the [] [but type in everything in between].

Database server type – [mysql] (default leave alone)
Database server hostname – [localhost] (only type in the word “localhost”)
Database name – [MyWebControlUserName_4images]
Database username – [MyWebControlUserName_MyDatabaseUserName]
Database password – [MyDatabasePassword]
Prefix for tables in database – [4images_] (default leave alone)
Admin username – [My4imagesAdminUserName] (to use within 4images)
Admin password – [My4imagesAdminPassword] (to use within 4images)
Admin password (Confirm) – [My4imagesAdminPassword] (to use within 4images)

If all went ok you should get the following screen, at least it’s the screen I got.

Install success!
The install script is unable to write the config file "config.php" to the server. Click the button below to download a copy of the configuration file and upload this file via FTP to the 4images directory. Once this is done you should log in using the admin username and password and visit the Control Panel to check the general configuration for any required changes." />

15) Click on the button [Download Configuration File] you will be given a choice to select a folder on YC to copy this to, I used C:\1\.

16) Open the file C:\1\config.php with notepad and edit it so it looks like the following, be careful. The green letters are a direct cut and past from my config.php with only name-value changes.


Code: [Select]
<?php
/**************************************************************************
 *                                                                        *
 *    4images - A Web Based Image Gallery Management System               *
 *    ----------------------------------------------------------------    *
 *                                                                        *
 *             File: config.php                                           *
 *        Copyright: (C) 2002 Jan Sorgalla                                *
 *            Email: jan@4homepages.de                                    *
 *              Web: http://www.4homepages.de                             *
 *    Scriptversion: 1.7                                                  *
 *                                                                        *
 *    Never released without support from: Nicky (http://www.nicky.net)   *
 *                                                                        *
 **************************************************************************
 *                                                                        *
 *    Dieses Script ist KEINE Freeware. Bitte lesen Sie die Lizenz-       *
 *    bedingungen (Lizenz.txt) für weitere Informationen.                 *
 *    ---------------------------------------------------------------     *
 *    This script is NOT freeware! Please read the Copyright Notice       *
 *    (Licence.txt) for further information.                              *
 *                                                                        *
 *************************************************************************/

$db_servertype "mysql";
$db_host "localhost";
$db_name "MyWebControlUserName_4images";
$db_user "MyWebControlUserName_MyDatabaseUserName";
$db_password "MyDatabasePassword";

$table_prefix "4images_";

define('4IMAGES_ACTIVE'1);

?>



17) Check the www.example.com/4images/ folder on YW and see if there is a config.php file if so delete it, also delete the config.new.php file from YW.

18) Copy the edited file config.php from C:\1\ on YC into www.example.com/4images/ folder of YW.

19) You will need an FTP program such as CuteFTP, WS_FTP or SmartFTP for much of the following modifications.

20) Go into YW and set permissions as shown for the following folders:

chmod 777 (drwxrwxrwx) : data
chmod 777 (drwxrwxrwx) : data/database
chmod 777 (drwxrwxrwx) : data/media
chmod 777 (drwxrwxrwx) : data/thumbnails
chmod 777 (drwxrwxrwx) : data/tmp_media
chmod 777 (drwxrwxrwx) : data/tmp_thumbnails
chmod 777 (drwxrwxrwx) : templates
chmod 777 (drwxrwxrwx) : templates/default
chmod 777 (drwxrwxrwx) : templates/default/media

and set permissions as shown for the following files:

chmod 666 (-rw-rw-rw-) : all the files in the directory "templates/default"
chmod 666 (-rw-rw-rw-) : all the files in the directory "templates/default/media"

21) Delete the file install.php from the folder www.example.com/4images/ on YW as this file can corrupt your site later if it is executed.

22) Additionally you may delete all the files in the www.example.com/4images/data/database/default folder on YW if you wish to save space.

23) At this point your basic installation is complete.

24) Open a browser on YC like Microsoft’s Internet Explorer and enter http://www.example.com/4images/admin/ and make any required changes.


Additional Information

a) 2003-11-25 Hello
I had trouble-using GD2 to create thumbnails it made my thumbnails very ugly; they looked a LOT better after I did this. I did have to delete my images and re-upload them to get results after I was done.
Copy constants.php from the folder www.example.com/4images/includes/ in YW to the C:\1\ folder on YC and edit it with notepad. Find a line that looks like this, define('CONVERT_IS_GD2', 0); and change it to this, define('CONVERT_IS_GD2', 1); . Delete constants.php from the folder www.example.com/4images/includes/ in YW and copy the edited constants.php file from the folder C:/1/ to the folder www.example.com/4images/includes/ in YW this should produce a higher quality thumbnail.

b) 2003-11-25 Hello
To get the maximum thumbnail width without pushing your right border past the right edge of the header bar use the following settings in admin control panel. This is based on three thumbnails per row. If you are scratching your head just set the thumbnail width to 200 pixels, upload three pictures into one category and you will see what I mean. I had to deleate my images and re-upload them to get results.
Control Panel Values Below (all other spacing values were left on default)
Image table cells - 3
Max. width of thumbnail in pixel - 140
Max. height of thumbnail in pixel - 140
Max. thumbnail size in KB - 20
Auto-create thumbnail - Yes
Thumbnail size in pixel - 140

c) 2005-01-09 Hello
I just loaded the 4images 1.7.1 on a new website and the instructions still worked fine.

8
Quote
I keep getting this message...

Warning: mysql_connect(): Too many connections in /home/user/public_html/4images/includes/db_mysql.php on line 39
This is a MySQL server configuration/load problem that only your hosting provider can resolve.  Contact them for assistance.

A quick fix is to restart the MySQL server which clears the overload of connections but does not prevent it from happening again.  Analysis of load and configuration settings is needed to devise a permanent solution.

9
FAQ, Tips / Cannot upload large files (larger than 2Mb)
« on: March 17, 2005, 04:15:49 AM »
Quote
I´ve got a problem uploading images or files larger than 2 MB. i have changed the image size in the settings but I still can´t upload more than 2 MB - it doesn´t even give me an error message. Does anyone have an idea of what could be wrong?

This is a limitation of your server's PHP configuration.  2Mb is the default upload file size limit when PHP is installed on a web server.  Only your hosting provider can change this setting inside php.ini

The other option is to first upload the file via FTP and then use the "Check New Images" function inside the admin control panel

[UPDATE]
Thanks to techmob for additional info on this topic.

The following settings in php.ini affect files upload:
Quote
file_uploads
1 to accept file uploads, 0 to not accept file uploads. Defaults to 1.


post_max_size
This is the maximum size of a POST request that PHP will accept. The default for PHP 4.3.x is 8M. If the file(s) you are trying to upload have a single or combined size over this value, PHP will exit. This affects the total post data. For example, if this were set to 8M and you are uploading four 3M files, PHP would not accept the files. You could, however, upload the four 3M files individually without a problem from this setting.


upload_max_filesize
This is the maximum size of an individual uploaded file. The default for PHP 4.3.x is 2M.


max_input_time
This is the maximum time PHP will accept input in seconds. The default for PHP 4.3.x is 60.

If you have access/persmission to modify settings directly in php.ini, do that, but if you can't do that AND your server is using Apache or other type of server that support .htaccess then you can insert the following into .htaccess in your gallery:
Code: [Select]
php_flag file_uploads on
php_value post_max_size "8M"
php_value upload_max_filesize "2M"
php_value max_input_time "60"
Change the values to satisfy your needs ;)

10
If u are making templates avalable for the public, try to avoid using PHP code inside the template, because many people experiensing lots of problems just cause of that!
Yes, I know, that by including "menu.php" file u can do changes in that file and without need editing each template. Agreed, that's the easiest way to do, but the side effect of that can cause number 2 problem discusing on this forum: eval() error.

so, what u can do about that? - simply replace all your <?php ... ?> code with {...} tag.
let me give u an idea how to do it.
lets say in your template u have this PHP code:
Code: [Select]
<?php
include('menu.php');
?>
this inserts in the template what ever is in /menu.php file.
most of the time the file contains plain HTML code.

now, you replace the PHP code (as above) with this tag: {4images_menu} (Explanation let's make it "standard" tag, that everyone would use same tag everywhere Wink). Then, u create a new template: /templates/<yourtemplate>/4images_menu.html with the code from menu.php
In the installation.txt guide u state, that if this is a first time installation of new template, then they should add two lines, in /includes/page_header.php file, at the end, just before closing ?>
Code: [Select]
$menu = (file_exists(TEMPLATE_PATH."/4images_menu.html")) ? $site_template->parse_template("4images_menu") : "";
$site_template->register_vars("4images_menu", $menu);

that's all, now all {4images_menu} tags will be replaces with whatever u put into 4mages_menu.html template.

Hope this will go as some sort of guide for templete developers, cause as I mentioned above, eval() error is number 2 problem after SAFE MODE, but work around it is much easier.

11
Error Messages / Fehlermeldungen / SAFE MODE errors
« on: March 17, 2005, 03:55:14 AM »
[ ENGLISH ]
There is no one-for-all fix for SAFE MODE problem, becase every host can manipulate restrictions in SAFE MODE as they wish.

Solutions:
1) ask your hoster to turn SAFE MODE to OFF.
2) if they are not willing to do so, try this: http://www.4homepages.de/forum/index.php?topic=3958.0
3) If the safe mode is turned off, and the problem still exists, or if the mod abive doesn´t work, try to delete all the folders in /data/media/ and /data/thumbnails (called /1 and /2 and so on: depends on the number of categories you´ve already created).
then create the folders by hand, name them 1 , 2 , 3 and so on.. don´t forget to set the folder rights (777).
4) change host

If none of the above worked please search on this forum, DO NOT START A NEW TOPIC REGARDING SAFE MODE ISSUE! it will be deleted at once.


[ DEUTSCH ]
Es gibt keine "ein-für-alle" Lösung für das SAFE MODE Problem, weil jeder Webspace-Anbieter die SAFE-MODE Beschränkungen selbst festlegen kann.

Lösungen:
1) frag dein Anbieter ob er die SAFE MODE Beschränkungen abschalten kann
2) falls er dies nicht will/macht, versuche die dies: http://www.4homepages.de/forum/index.php?topic=3958.0
3) Wenn SAFE MODE abgeschaltet ist und das Problem immer noch existiert, oder die oben genannte Änderung nicht geholfen hat:
versuche alle Verzeichnisse in /data/media/ und in /data/thumbnails/ (mit Namen wie /1 und /2 usw., je nach Anzahl der Kategorien, die Du schon erstellt hast) zu löschen.
Erstelle die Verzeichnisse danach Manuell und benenne diese 1, 2, 3, usw. und vergiss nicht die Rechte per CHMOD auf 777 zu setzen

Wenn keiner der oben genannten Punkte helfen sollte, such erst im Forum nach weiteren Lösungen. Neue Themen zu SAFE MODE werden gelöscht.

[ РУССКИЙ ]

Для проблемы с SAFE MODE не существует заплатки которая бы работала для всех, потому-что администрация серверов может изминять ограничения как им угодно - на одном сервере одно ограничение, на другом другое.

Возможные пути обхода ограничений:
1) попросите администрацию сервера отклучить SAFE MODE (удачи ;)).
2) если отключение не возможно, то попробуйте этот мод: http://www.4homepages.de/forum/index.php?topic=3958.0
3) если SAFE MODE отключено, но проблема осталась, или мод не помог, попробуйте удалить а потом востановить через FTP все папки в /data/media/ директории (не забудьте сделать CHMOD 0777 на новых папках)
4) найдите другой сервер

Если ничего не помогло, пожалуйста ищите на форуме, НЕ НАЧИНАЙТЕ НОВЫЕ ТОПИКИ НА ТЕМУ SAFE MODE!, эта тема обсуждалась столько раз, что теперь новые топики на эту тему просто будут удалятся без предупреждения.

12
These errors usually happen when something is wrong with MySQL server, in most cases it runs out of free space for temporary files.
The only thing u can do is contact your hoster, they are the only who can fix it (unless of course u have root access to the server).

13
When trying to upload a file using your web browser, you get an error like this:
Quote
Warning: move_uploaded_file(./data/media/1/sample.jpg): failed to open stream: No such file or directory in /local/home/sites/example.com/4images/includes/upload.php on line 114

Warning: move_uploaded_file(): Unable to move '/tmp/php5zVufY' to './data/media/1/sample.jpg' in /local/home/sites/example.com/4images/includes/upload.php on line 114

If after correctly setting directory permissions as instructed in docs/Installation.txt and following the suggestion in this FAQ post you still get this error, then you may have encountered a limitation due to PHP Safe Mode being turned on by your host.

You can ask your host if safe mode is turned on and, if it is, ask them to turn it off (be sure to explain why!). Or you might try the installing the mod for bypassing Safe Mode in the published mods forum.

You can check if SAFE MODE is set by creating a file named phpinfo.php and placing this inside it:
Code: [Select]
<?php
phpinfo
();
?>

Upload it to the top-level of your web site and load http://www.example.com/phpinfo.php in your browser.

Under the
Quote
Configuration
PHP Core
section, look for a table row that says:
Code: [Select]
Directive          Local Value          Master Value
safe_mode          Off                  Off

If either value is set to On, then you have safe_mode enabled in PHP for your web site.

14
Templates & Styles (Releases & Support) / [Template] 7dana Template
« on: March 16, 2005, 04:42:18 AM »
RESTORED FROM SEARCH ENGINE CACHE: ORIGINALLY POSTED BY zaja

Hi,

I've made a simple and clean template for 4images gallery (v.1.7.1)....in light-gray colors.
Compatible with 800x600 (or higher) screen resolution and with 99% of web-browsers.
Feel free to download, use, and enjoy the template. (PSD for logo included in download package.)

Download see Attachment
_________________

www.7dana.com » Web Design

15
Bug Fixes & Patches / [1.7] Quotes in category names
« on: March 16, 2005, 04:32:40 AM »
If you create a category with a double quoted word, for example: This is "crazy". It ends up in the database with quotes and is displayed with quotes when rendered in html as simple text. However, when it is used as the value for an edit control, e.g. in Edit Category (action=editcat) the quoted part does not appear.

in /admin/categories.php find:

Code: [Select]
  show_input_row($lang['field_category_name'], "cat_name", $result['cat_name'], $textinput_size);
and replace it with:

Code: [Select]
  show_input_row($lang['field_category_name'], "cat_name", str_replace("\"", "&quot;", $result['cat_name']), $textinput_size);

Pages: [1] 2 3 4 5