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.

Messages - Sun Zaza

Pages: 1 2 3 4 [5] 6 7 8 9 ... 34
Messing with the code? It is almost done with 2 steps. Maybe with your help, it will be better. Check this out:

Open db_field_definition.php


$additional_image_fields['image_date2'] = array($lang['training_date2'], "input_date"0);

Open admin/admin_functions.php


case "radio":
show_radio_row($val[0], $field_name, ($value == "") ? $value);


case "input_date":         
show_date_input_row($val[0], $field_name$value);

The problem now is the database save only the year (For example: 2010 or 1999)

Any help please?

Hey guys,

This time I have a very difficult request:

Thanks to v@no we can use a dropdown box as an additional field, but what about showing a date input like choosing the image date in ADD IMAGE.

I believe there is a way to call  the function "show_date_input_row" from db_fields_definitions (You can find this function in admin_functions).

Am I asking something impossible?

I will hear it from you guys.

PS: Please let's take 4images to a higher level :wink:


I believe I will do it myself. Almost done, but I think I need some help.

Thanks v@no. I didn't expect that those lines will be so simple. Now I can going on with my project.
You get another THANK YOU from me.

Now I understand. Very useful. Thanks v@no.


I spent more than 4 hours looking in my 4images gallery for the code who redirect the users to the homepage when you use an image_id which does not exist.

For example:


First I thought this code do this action:

if (!$image_id) {

but when I deleted it, I still be redirected to the homepage.

Any Idea?


Can someone explain to me where can I use the new additional tags like categories, details,index, because I didn't get it yet.

Added more conditional tags (categories, details,index, member, postcards, register, search, top) for using {if index}...{if index} for homepage, {if details}...{endif details} for details.php page, etc

Do you have an example for me please? I want to see how useful the new tags are.

Thanks in advance,

Mods & Plugins (Requests & Discussions) / Re: Table seperator issue
« on: January 17, 2010, 10:35:35 PM »
Perfect v@no. Thanks man.

I got a parse error:

Parse errorsyntax errorunexpected T_STRINGexpecting T_VARIABLE or '$' in /hsphere/local/home

Any idea?

                (cat_id, user_id, image_name, image_description, image_keywords, image_date, image_active, image_media_file, image_thumb_file, image_download_url, image_allow_comments, image_date2"
$cat_id$user_id, '$image_name', '$image_description', '$image_keywords', $current_time$image_active, '$new_name', '$new_thumb_name', '$image_download_url', $image_allow_comments$image_date2".$additional_value_sql, .")";
$result $site_db->query($sql);
$image_id $site_db->get_insert_id();

Hey guys,

I have a problem:

I added a new field to my images table via admin/images.php. (Not an additional field)

show_date_input_row($lang['field_image_date2'].$lang['date_format'], "image_date2"$images['image_date2'], $textinput_size);

Till now everything is doing fine, but the problem is when it is empty (0), het shows this date: 1969-12-31 18:00:00 instead of nothing (Empty).

PS: Only by editing an image. During adding an new image, he shows an empty field.

Does anyone knows how to solve this issue?

Any help will be appreciated.


Mods & Plugins (Requests & Discussions) / Table seperator issue
« on: January 17, 2010, 12:51:27 PM »

A few month ago V@no helped me to organize my ACP when you add a lot of additional fields to your gallery.
I added a table separator between different sections. I do it like this:

Open admin_functions.php
function show_additional_fields($type "image"$image_row = array(), $table IMAGES_TEMP_TABLE$i 0) {

$field_type_array "additional_".$type."_fields";
  global ${

  if (!empty(${
$field_type_array})) {
$table_fields $site_db->get_table_fields($table);
    foreach (${
$field_type_array} as $key => $val) {
      if (!isset(
$table_fields[$key])) {

Add after:
if (in_array($key, array("user_extra_info")))
show_table_separator("user extra info");

It workt perfect till today. I encounter a problem:

What will happend if you have 2 additional fields for images and users with the same name? For example:

$additional_user_fields['user_extra_info'] = array($lang['user_extra_info'], "text", 0);
$additional_image_fields['user_extra_info'] = array($lang['user_extra_info'], "text", 0);

I believe you wil get the table seperator in images and users, but what about you don't want it in images? Only in users ACP.

How can we solve that?

Can we use something like:

if (in_array($keyuser_row("user_extra_info")))
show_table_separator("user extra info");

Hello V@no,

As you know and everybody also do, you made the best and the most difficult mod ever coded for 4images. I am talking about:
[MOD] Batch Copy/Move/Edit Images v4.14.1 (2008-12-30)

I am using it everyday more than google :wink:

I am thinking about a light version for the users table. Especially the Quick edit option. It will be very usefull for the Admin when you have a lot of additional field and you want to edit them.

For example:
You add 5 new users to your gallery and you want to edit there birthdate, address, hobby....
This mod will help you to do that in few minutes.

Do you feel like coding it V@no?

Many thanks in advance,

Programming / Re: Getting information in 2 columns instead of 1(List)
« on: January 17, 2010, 11:35:35 AM »
How can we do that?
look at the top of the code:
$rows= ($total_images/2) ;

 90 / 2 = 45

But if you have 91 images, you will get: 45, 45 and 1 (In 3 columns). Let's say we want 2 columns: 45 and 46. (Like in categories in the homepage).

PS: I tried to study the function (get_categories) in the functions.php, but it was too much for my poor PHP knowledge.

Programming / Re: Getting information in 2 columns instead of 1(List)
« on: January 17, 2010, 10:57:34 AM »
Good morning Andy,

I love it when you don't use tables in your code. Let take 4images to another level :wink:

A small correction:

1- use $count or $i in your code instead of both.

2- Change:
$count 0;


$count 1;

Otherwise your list will start with the number 0.

So your code will look like this:

//$rows=40; //Wrap after how many lines
$rows= ($total_images/2) ;

$count 1
$sx 0;  
$video_list "<div style=\"float:left;\">";
while (
$image_row $site_db->fetch_array($result)){
$video_list .= ($sx%$rows == 0) ? "</div>":"";
$video_list .= ($sx%$rows == 0) ? "<div style=\"float:left\">":"";
$video_list .= "<span style=\"margin-right:20px\"  >".$count +."- <a href=\"".$site_sess->url(ROOT_PATH."details.php?image_id=".$image_row['image_id'])."\">".$image_row['image_name']."</a></span><br>"

$video_list .= "</div style=\"clear:both\">\n";

This code is working perfect and solve the earlier problem (I will use it for another project :wink:), but now you can get more that 2 columns. Because if you have 90 images, you will get 3 columns:40, 40 and 10.

Let say for our template we want only 2 columns.

How can we do that?

Programming / Re: Getting information in 2 columns instead of 1(List)
« on: January 16, 2010, 10:18:30 PM »
Thanks Andy. Almost how I wandted.

I believe your code should look like this:

$i 1;
$trcounter 0;  
$video_list "<table>\n";
while (
$image_row $site_db->fetch_array($result)){

$video_list .= ($trcounter++ % == 0) ? "<tr>" "";
$video_list .= "<td valign=\"top\" class=\"sortable\">
.$i++."- <a href=\"".$site_sess->url(ROOT_PATH."details.php?image_id=".$image_row['image_id'])."\">".$image_row['image_name']."</a></td>\n"
$video_list .= "</table>\n";

Now I encounter another problem. I got 2 colomn like this:


instead of:


How can we solve that? Because you have to go throuw the first column till the end and then you jump the second column.

Pages: 1 2 3 4 [5] 6 7 8 9 ... 34