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 - MrAndrew

Pages: 1 2 [3] 4
31
Discussion & Troubleshooting / Problem with paging and stats [SOLVED]
« on: September 05, 2010, 10:42:09 AM »
Please help me solve this problem.

When i have a 5 new images, paging must show 1 page only, and statistic must show search 5 images...

Paging show 5 pages, and 47 images search!!

Where is the error? What`s wrong? What file need to see?

Thanks

32
Programming / Extract info from DB
« on: September 04, 2010, 04:15:41 PM »
Hi to all.

I need some help. I want to extract all info of photo by one field of database. For this i need to extract some fields from DB. I`ve written a code for extract this but cannot complete this, becouse i`m not programmist. Please help me anyone. My exemple:

It must work next: when i changed image registration from dropdown menu, other information need to be extract from database, and show in the inputs. This code extract information randomly, and dropdown not extract values of image_reg. What need to be changed and what is wrong?

Code: [Select]
$sql = "SELECT * FROM 5images_images WHERE image_reg=\"".$image_reg."\"";
$result = mysql_query($sql);

  $image_autofill .= "<select name=\"image_reg\">";
  $image_autofill .= "<option value=\"0\">-- Chose Reg --</option>";
    $image_autofill .= "<option value=\"$row[image_reg]\" name=\"image_registrations\">$row[image_reg]</option>";
      $image_autofill .= "</select>";
   
while ($row = mysql_fetch_assoc($result)) {
      echo "<input type=\"text\" name=\"image_airline\" value=\"$row[image_airline]\" class=\"input\" size=\"30\" class=\"input\">";     

}
   

$site_template->register_vars("image_autofill", $image_autofill);
unset($image_autofill);

Many thanks!

33
VERSION 1.01 (Updated 27/03/2011)

Description: This mod will show to user, which of his photos, awaiting validation.

Bug fixes:
1. Correct view and image counter
2. Add paging

Always backup files, which will need to be change!!!

1. File to create is awaiting.php

add:

<?php

$templates_used 
'awaiting,awaiting_images_bit';
$main_template 'awaiting';

define('GET_CACHES'1);
define('GET_USER_ONLINE'1);
define('ROOT_PATH''./');
include(
ROOT_PATH.'global.php');
require(
ROOT_PATH.'includes/sessions.php');
$user_access get_permission();
include(
ROOT_PATH.'includes/page_header.php');

  
$logged_in_id trim($user_info['user_id']);
    
$sql "SELECT COUNT(*) AS num_rows_all
            FROM "
.IMAGES_TEMP_TABLE." i
            WHERE i.user_id = 
$logged_in_id";
    
$row $site_db->query_firstrow($sql);
    
$num_rows_all $row['num_rows_all'];

include(
ROOT_PATH.'includes/paging.php');
  
$getpaging = new Paging($page$perpage$num_rows_all$link_arg);
  
$offset $getpaging->get_offset();
  
$site_template->register_vars(array(
    
"paging" => $getpaging->get_paging(),
    
"paging_stats" => $getpaging->get_paging_stats()
  ));
        

$imgtable_width ceil(intval($config['image_table_width']) / $config['image_cells']);
if ((
substr($config['image_table_width'], -1)) == "%") {
  
$imgtable_width .= "%";
}

$additional_sql "";
if (!empty(
$additional_image_fields)) {
  foreach (
$additional_image_fields as $key => $val) {
    
$additional_sql .= ", i.".$key;
  }
}

  
$sql "SELECT i.image_id, i.cat_id, i.user_id, i.image_name, i.image_description, i.image_keywords, i.image_date, i.image_media_file, i.image_thumb_file".$additional_sql.get_user_table_field(", u.""user_name")."
          FROM ("
.IMAGES_TEMP_TABLE." i)
          LEFT JOIN "
.USERS_TABLE." u ON (".get_user_table_field("u.""user_id")." = i.user_id)
          WHERE i.user_id = 
$logged_in_id
          ORDER BY i.image_date DESC
          LIMIT 
$offset$perpage";



  
$result $site_db->query($sql);
$num_rows $site_db->get_numrows($result);

$awaiting_new_images "";
if (!
$num_rows)  {
  
$awaiting_new_images .= "<TABLE CELLPADDING=0 CELLSPACING=0 BORDER=0><TR><TD><IMG HEIGHT=\"4\" BORDER=\"0\" SRC=\"trans.gif\"></TD></TR></TABLE>";
  
$awaiting_new_images .= "<table align=\"center\" width=\"".$config['image_table_width']."\" border=\"0\" cellpadding=\"0\" cellspacing=\"1\" bgcolor=\"#434242\" width=\"100%\"><tr><td align=\"center\" class=\"row1\">";
  
$awaiting_new_images .= "<b><font size=\"2\">".$lang['awaiting_images_no']."</font></b>";
  
$awaiting_new_images .= "</td></tr></table>";
}

else  {
  
$awaiting_new_images .= "<table width=\"".$config['image_table_width']."\" border=\"0\" cellpadding=\"".$config['image_table_cellpadding']."\" cellspacing=\"".$config['image_table_cellspacing']."\">\n";
  
$count 0;
  
$bgcounter 0;
  
$prev_image_id = -1;
  while (
$image_row $site_db->fetch_array($result)) {
    if (
$image_row['image_id'] == $prev_image_id) { 
      continue;
    }
    
$prev_image_id=$image_row['image_id'];
    if (
$count == 0) {
      
$row_bg_number = ($bgcounter++ % == 0) ? 2;
      
$awaiting_new_images .= "<tr class=\"imagerow".$row_bg_number."\">\n";

    }
    
$awaiting_new_images .= "<td width=\"".$imgtable_width."\" valign=\"top\">\n";

    
show_image_awaiting($image_row"awaiting");
    
$awaiting_new_images .= $site_template->parse_template("awaiting_images_bit");
    
$awaiting_new_images .= "\n</td>\n";
    
$count++;
    if (
$count == $config['image_cells']) {
    
$awaiting_new_images .= "</tr>\n";

      
$count 0;
    }
  } 
// end while

  
if ($count 0)  {
    
$leftover = ($config['image_cells'] - $count);
    if (
$leftover >= 1) {
      for (
$f 0$f $leftover$f++) {
      
$awaiting_new_images .= "<td width=\"".$imgtable_width."\">\n&nbsp;\n</td>\n";

      }
      
$awaiting_new_images .= "</tr>\n";
    }
  }
  
$awaiting_new_images .= "</table>\n";
}  
// end else

$site_template->register_vars("awaiting_new_images"$awaiting_new_images);
unset(
$awaiting_new_images);

$site_template->register_vars(array(
  
"msg" => $msg,
  
"clickstream" => $clickstream,
  
"lang_userlist_title" => $lang['lang_userlist_title']
));
$site_template->print_template($site_template->parse_template($main_template));
include(
ROOT_PATH.'includes/page_footer.php');
?>


2. File to change is  includes/functions.php


find:
function get_thumbnail_code($media_file_name$thumb_file_name ""$image_id$cat_id$image_name ""$mode ""$show_link 1$open_window 0) {
  global 
$site_sess$config;

  if (!
check_media_type($media_file_name)) {
    
$thumb "<img src=\"".ICON_PATH."/404.gif\" border=\"0\" alt=\"\" />";
  }


before add:

// -----------------------------------------------
// --- Start Mod "my awaiting images" ------------
//------------------------------------------------

function show_image_awaiting($image_row$mode ""$show_link 1$detailed_view 0) {
  global 
$self_url$site_template$site_sess$user_info$config$cat_cache$lang$additional_image_fields$user_table_fields$url_show_profile;

  if (!
check_permission("auth_viewimage"$image_row['cat_id']) || !check_permission("auth_viewcat"$image_row['cat_id'])) {
    
$show_link 1;
  }

  if (isset(
$image_row[$user_table_fields['user_name']]) && $image_row['user_id'] != GUEST) {
    
$user_name format_text($image_row[$user_table_fields['user_name']], 2);

    
$user_profile_link = (!empty($url_show_profile)) ? str_replace("{user_id}"$image_row['user_id'], $url_show_profile) : ROOT_PATH."member.php?action=showprofile&amp;".URL_USER_ID."=".$image_row['user_id'];
    
$user_name_link "<a href=\"".$site_sess->url($user_profile_link)."\">".$user_name."</a>";
  }
  else {
    
$user_name format_text($lang['userlevel_guest'], 2);
    
$user_name_link $user_name;
  }

  
$site_template->register_vars(array(
    
"image_id" => $image_row['image_id'],
    
"user_id" => $image_row['user_id'],
    
"image_date" => format_date($config['date_format']." ".$config['time_format'], $image_row['image_date']),
    
"user_name" => $user_name,
    
"user_name_link" => $user_name_link,
    
"image_name" => format_text($image_row['image_name'], 2),
    
"image_url" => ($show_link) ? $site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$image_row['image_id'].((!empty($mode)) ? "&amp;mode=".$mode "")) : "",
    
"thumb" => get_thumbnail_code_awaiting($image_row['image_media_file'], $image_row['image_thumb_file'], $image_row['image_id'], 0$image_row['image_name'], $mode$show_link),
    
"image_file_name" => $image_row['image_media_file'],
    
"thumbnail_file_name" => $image_row['image_thumb_file']
  ));

  if (!empty(
$additional_image_fields)) {
    
$additional_field_array = array();
    foreach (
$additional_image_fields as $key => $val) {
      
$additional_field_array[$key] = (!empty($image_row[$key])) ? format_text($image_row[$key], 1) : REPLACE_EMPTY;
      
$additional_field_array['lang_'.$key] = $val[0];
    }
    if (!empty(
$additional_field_array)) {
      
$site_template->register_vars($additional_field_array);
    }
  }
  return 
true;
}



function 
get_thumbnail_code_awaiting($media_file_name$thumb_file_name ""$image_id$cat_id$image_name ""$mode ""$show_link 1$open_window 0) {
  global 
$site_sess$config;
  
    
$max 0.6// Hier maximale Breite der Thumbnails in Pixel eingeben !

  
if (!check_media_type($media_file_name)) {
    
$thumb "<img src=\"".ICON_PATH."/404.gif\" border=\"0\" alt=\"\" />";
  }
  else {
    if (!
get_file_path($thumb_file_name"thumb"$cat_id00)) {
      
$file_src ICON_PATH."/".get_file_extension($media_file_name).".gif";
      
$image_info = @getimagesize($file_src);
      
$thumb_width $image_info[0]*$max;
      
$thumb_height $image_info[1]*$max;
      
$thumb "<img src=\"data/tmp_thumbnails/".$thumb_file_name."\" style=\"border:0;width:$thumb_width ; height:$thumb_height ;\"  alt=\"".format_text($image_name2)."\" />";
    }
    else {
      
$file_src get_file_path($thumb_file_name"thumb"$cat_id01);
      
$image_info = @getimagesize($file_src);
      
$thumb_width $image_info[0]*$max;
      
$thumb_height $image_info[1]*$max;
      
$thumb "<img src=\"data/tmp_thumbnails/".$thumb_file_name."\" style=\"border:0;width:$thumb_width ; height:$thumb_height ;\"  alt=\"".$image_name."\"  />";
    }
  }

  if (
$show_link) {
    if (
$open_window) {
      
$thumb "<a href=\"/data/tmp_media/".$media_file_name."\" onclick=\"opendetailwindow()\" target=\"detailwindow\">".$thumb."</a>";
    }
    else {
      
$thumb "<a href=\"/data/tmp_media/".$media_file_name."\" target=\"_blank\">".$thumb."</a>";
    }
  }
  return 
$thumb;
}
// -----------------------------------------------
// --- End Mod "my awaiting images" --------------
//------------------------------------------------


3. create: awaiting.html
add:
Code: [Select]
{header}
<table width="640" border="0" cellspacing="0" cellpadding="0" align="center">
  <tr>
    <td>
      <table width="640" border="0" cellspacing="0" cellpadding="0" class="tablehead">
        <tr>
          <td colspan="4"><img src="{template_url}/images/header_top.gif" width="640" height="6" alt="" /></td>
        </tr>
        <tr>
          <td width="6"><img src="{template_url}/images/header_left.gif" width="6" height="60" alt="" /></td>
          <td width="405"><img src="{template_url}/images/header_logo.gif" width="405" height="60" alt="" /></td>
          <td width="225" align="right">
            <form method="post" action="{url_search}">
              <table border="0" cellspacing="0" cellpadding="1">
                <tr>
                  <td>
                    <input type="text" name="search_keywords" size="15" class="searchinput" />
                  </td>
                  <td>
                    <input type="submit" value="{lang_search}" class="button" name="submit" />
                  </td>
                </tr>
                <tr valign="top">
                  <td colspan="2"><a href="{url_search}" class="smalltext">{lang_advanced_search}</a></td>
                </tr>
              </table>
            </form>
          </td>
          <td align="right" width="6"><img src="{template_url}/images/header_right.gif" width="6" height="60" alt="" /></td>
        </tr>
      </table>
    </td>
  </tr>
  <tr>
    <td class="bordercolor">
      <table width="640" border="0" cellspacing="1" cellpadding="0">
        <tr>
          <td class="tablebgcolor">
            <table width="638" border="0" cellspacing="1" cellpadding="0">
              <tr>
                <td height="23" class="navbar">
                  <table width="636" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                      <td><img src="{template_url}/images/spacer.gif" width="4" height="4" alt="" />{clickstream}</td>
                      <td align="right"> <a href="{url_top_images}"><b>{lang_top_images}</b></a>&nbsp; <a href="{url_new_images}"><b>{lang_new_images}</b></a>&nbsp; </td>
                    </tr>
                  </table>
                </td>
              </tr>
            </table>
            <table width="638" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td width="150" valign="top" class="row2">
                  <table width="150" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                      <td class="head2" height="20"><img src="{template_url}/images/spacer.gif" alt="" width="4" height="4" />{lang_registered_user}</td>
                    </tr>
                    <tr>
                      <td class="tablebgcolor"><img src="{template_url}/images/spacer.gif" alt="" width="1" height="1" /></td>
                    </tr>
                    <tr>
                      <td align="center" class="row1">{user_box}</td>
                    </tr>
                    <tr>
                      <td class="tablebgcolor"><img src="{template_url}/images/spacer.gif" alt="" width="1" height="1" /></td>
                    </tr>
                  </table>
                  {if random_cat_image}
                  <table width="150" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                      <td class="head2" height="20"> <img src="{template_url}/images/spacer.gif" alt="" width="4" height="4" />{lang_random_image}</td>
                    </tr>
                    <tr>
                      <td class="tablebgcolor"><img src="{template_url}/images/spacer.gif" alt="" width="1" height="1" /></td>
                    </tr>
                    <tr>
                      <td align="center" class="row1"> <br />
                        {random_cat_image} <br />
                        <br />
                      </td>
                    </tr>
                    <tr>
                      <td class="tablebgcolor"><img src="{template_url}/images/spacer.gif" alt="" width="1" height="1" /></td>
                    </tr>
                  </table>
                  {endif random_cat_image} </td>
                <td width="1" class="bordercolor" valign="top"><img src="{template_url}/images/spacer.gif" width="1" height="1" alt="" /></td>
                <td width="18" valign="top"><img src="{template_url}/images/spacer.gif" width="18" height="18" alt="" /></td>
                <td width="450" valign="top"><br />
                  <b class="title">{lang_top100}</b>
                  <hr size="1" />
                   <div align="center">{awaiting_new_images}
                  <p>&nbsp;</p>
                </td>
                <td width="20" valign="top"><img src="{template_url}/images/spacer.gif" width="19" height="19" alt="" /></td>
              </tr>
            </table>
          </td>
        </tr>
      </table>
    </td>
  </tr>
  <tr>
    <td>
      <table width="640" border="0" cellspacing="0" cellpadding="0" class="tablebottom">
        <tr>
          <td width="6"><img src="{template_url}/images/footer_left.gif" width="6" height="19" alt="" /></td>
          <td width="405">&nbsp;</td>
          <td width="225">&nbsp;</td>
          <td width="6"><img src="{template_url}/images/footer_right.gif" width="6" height="19" alt="" /></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
{footer}

4. Create awaiting_images_bit.html with same code with your thumbnail_bit.html

Find:
Code: [Select]
{thumbnail}
Replace it:
Code: [Select]
{thumb}
5. Open lang/english/main.php

before:
?>

add:
$lang['awaiting_images'] = "My Queued Photos";
$lang['awaiting_images_no'] = " You haven`t images in queue at this time.";


6. Open includes/page_header.php

Find:
"lang_control_panel" => $lang['control_panel'],

add after:
"lang_awaiting_images" => $lang['awaiting_images'],

Find:
 "Url_login" => (! Empty ($ url_login))? $ Site_sess-> url ($ url_login): $ site_sess-> url (ROOT_PATH"login.php"),

add before:
  "Url_awaiting" => $ site_sess-> url (ROOT_PATH"awaiting.php"),

7. Open home.html

add this, when you want to see the link:
Code: [Select]
<a href="{url_awaiting}">{lang_awaiting_images}</a>
Upload:
awaiting.php to the root
functions.php to root/includes
page_header.php to root/includes
main.php to root/lang/english
awaiting.html, home.html and awaiting_images_bit.html to templates

In case you want to show category name of the awaiting photo, perform this step: (http://www.4homepages.de/forum/index.php?topic=27806.0;msg=158563)

34
Okey, this is a final version MOD "One photo big, and other small"

Version 1.1
Javascript support

Version 1.0
First release

This was created with a big V@no support! Many thanks V@no!

Description: This mod will give you possible to show one thumbnail BIG, and other small. I.E. For something tops, when you want to see first place of image big, and second and third small images.

With new version you may add javascript support, for change thumbnails on mouseover...

DEMO There (See TOP Shots)

RMK: For this mod you need to install [MOD] Second Thumbnail Size - http://www.4homepages.de/forum/index.php?topic=25017.0
This MOD include [MOD] - Most Rates Images Today

New files: msrates.php, msrates_image.html

Files to edit: index.php, functions.php

Install

1. Create a file msrates.php with code then upload file to main directory:

Code: [Select]
<?php

$msrates_images 
time() - 60 60 24 2;

$imgtable_width ceil(intval($config['image_table_width']) / $config['image_cells']);
if ((
substr($config['image_table_width'], -1)) == "%") {
  
$imgtable_width .= "%";
}

$additional_sql "";
if (!empty(
$additional_image_fields)) {
  foreach (
$additional_image_fields as $key => $val) {
    
$additional_sql .= ", i.".$key;
  }
}

$sql "SELECT i.image_id, i.cat_id, i.user_id, i.image_name, i.image_description, i.image_keywords, i.image_date, i.image_active, i.image_media_file, i.image_thumb_file, i.image_download_url, i.image_allow_comments, i.image_comments, i.image_downloads, i.image_votes, i.image_rating, i.image_hits".$additional_sql.", c.cat_name".get_user_table_field(", u.""user_name")."
        FROM ("
.IMAGES_TABLE." i,  ".CATEGORIES_TABLE." c)
        LEFT JOIN "
.USERS_TABLE." u ON (".get_user_table_field("u.""user_id")." = i.user_id)
        WHERE i.image_active = 1 AND c.cat_id = i.cat_id AND i.image_date >= " 
$msrates_images " AND i.cat_id NOT IN (".get_auth_cat_sql("auth_viewcat""NOTIN").")
        ORDER BY i.image_rating DESC
        LIMIT 4"
;
        
$result $site_db->query($sql);
$num_rows $site_db->get_numrows($result);

if (!
$num_rows)  {
  
$msrates_new_images "<table align=\"center\" width=\"".$config['image_table_width']."\" border=\"0\" cellpadding=\"".$config['image_table_cellpadding']."\" cellspacing=\"".$config['image_table_cellspacing']."\"><tr class=\"imagerow1\"><td>";
  
$msrates_new_images .= $lang['no_today_images'];
  
$msrates_new_images .= "</td></tr></table>";
}
else  {
  
$msrates_new_images "<table align=\"center\" width=\"250\" border=\"0\" cellpadding=\"1\" cellspacing=\"0\">";
  
$count 0;
  
$bgcounter 0;
  while (
$image_row $site_db->fetch_array($result)) {
    
$row_bg_number = ($bgcounter++ % == 0) ? 2;

    
$msrates_new_images .= "<td width=\"25\" align=\"center\"" . (!$count 'colspan="3"' '') .">";

    
show_image($image_row);

    
$site_template->register_vars("msrates_images_type", ($count)); //is $count > 0 ?
    
$msrates_new_images .= $site_template->parse_template("msrates_image");
    
$msrates_new_images .= "</td>";
    if (!
$count)
    {
      
$msrates_new_images .= "</tr>";
    }
    
$count++;
  } 
// end while
  
$msrates_new_images .= "</table>";
}  
// end else

$site_template->register_vars("msrates_images"$msrates_new_images);
unset(
$msrates_new_images);
?>

2. Create file msrates_image.html with code: {ifno msrates_images_type}{thumbnail}{endifno msrates_images_type}{if msrates_images_type}{thumbnail_small}{endif msrates_images_type} then upload to your templates directory

3. Add to your index.php next line:

Search:
Code: [Select]
include(ROOT_PATH.'global.php');
Add after:
Code: [Select]
include(ROOT_PATH.'msrates.php');
----------------------------Update for V1.1----------------------------

4. Download attached file thumbnailviewer2.js
and upload it to the root gallery

5. Open templates/msrates_image.html and replace:


{ifno msrates_images_type}{thumbnail}{endifno msrates_images_type}{if msrates_images_type}{thumbnail_small}{endif msrates_images_type


With this:

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<
script type="text/javascript" src="thumbnailviewer2.js"></script>

<
div id="loadarea">{ifno msrates_images_type}{thumbnail}{endifno msrates_images_type}<br></div>
{if 
msrates_images_type}{thumbnail_small}{endif msrates_images_type}</div>


6. Open includes/functions.php and search:

Take care, this must be your small size thumnail code!
$thumb "<img src=\"".$file_src."\" style=\"border:0;width:$thumb_width ; height:$thumb_height ;\"  alt=\"".$image_name."\"  />";

Replace:

      $thumb "<a href=\"".$file_src."\" rel=\"enlargeimage\" target=\"_blank\" rev=\"targetdiv:loadarea,fxduration: 700,link:".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$image_id.((!empty($mode)) ? "&amp;mode=".$mode ""))."\"><img src=\"".$file_src."\" style=\"border:0;width:$thumb_width;height:$thumb_height;link:$image_url\"/></a>";


Installation complete! I hope you enjoy it!!!

P.S. In this path you can set how many pictures to show
1.
Code: [Select]
LIMIT 4"; - It will show 4 images
2.
You can set how sort you top.
Code: [Select]
ORDER BY i.image_rating DESCChange this part to change sort what you want. I.E. i.image_hits ....

DEMO:
In my gallery this MOD show as: see attach




35
Discussion & Troubleshooting / Which file need to change?
« on: August 05, 2010, 06:28:23 AM »
Good day to all...

I have this problem... Why yandex exlude mu links and give error status as: http://www.mydomain.ru/http:/mydomain.ru/img1009.htm - 404 error, page not found?

Which file i need to correct?

Thx

36
Discussion & Troubleshooting / Error in SQL syntax
« on: July 31, 2010, 08:10:25 PM »
Plese hepl me find incorrect request.. I`ve got this error when i save homepage, icq or skype in edit profile

Code: [Select]
DB Error: Bad SQL Query: UPDATE 5images_users SET user_email = 'dyubin-andrew@mail.ru', user_showemail = 0, user_allowemails = 1, user_invisible = , user_homepage = '', user_icq = '', user_skype = 'adyubin' = 'adyubin', user_skype = 'adyubin' WHERE user_id = 20
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ' user_homepage = '', user_icq = '', user_skype = 'adyubin' = 'adyubin', user_sk' at line 2

This is my parametres:

1.
Code: [Select]
    $sql = "UPDATE ".USERS_TABLE."
            SET ".get_user_table_field("", "user_email")." = '$user_email', ".get_user_table_field("", "user_showemail")." = $user_showemail, ".get_user_table_field("", "user_allowemails")." = $user_allowemails, ".get_user_table_field("", "user_invisible")." = $user_invisible, ".get_user_table_field("", "user_homepage")." = '$user_homepage', ".get_user_table_field("", "user_icq")." = '$user_icq'".$additional_sql." ".get_user_table_field("", "user_skype")." = '$user_skype'".$additional_sql."
            WHERE ".get_user_table_field("", "user_id")." = ".$user_info['user_id'];

2.
Code: [Select]
$user_skype = (isset($HTTP_POST_VARS['user_skype'])) ? un_htmlspecialchars(trim($HTTP_POST_VARS['user_skype'])) : "";
3.
Code: [Select]
$user_skype = (isset($user_row['user_skype'])) ? $user_row['user_skype'] : REPLACE_EMPTY;
Thanks for your help!


37
Discussion & Troubleshooting / Strange error..
« on: July 12, 2010, 03:51:56 PM »
Please help me resolve my problem:

When i as admin upload pictures to the site it`s ok.

When user upload his pictures, first pic upload OK, but second picture give him error:


An unexpected error occured. Please try again later.

Code: [Select]
Bad SQL Query: INSERT INTO 5images_images_temp
                (cat_id, user_id, image_name, image_description, image_keywords, image_date.....image_reg, image_serial, image_dateday, image_datemonth, image_dateyear, image_md5)
                VALUES
                (1, 43, 'Germany', '', '', 1278942630, '1e8e8642614ec3c3dad70f4cf232dd0f.jpg', '1e8e8642614ec3c3dad70f4cf232dd0f.jpg', '', 'civil', '', '', '', '', '', '', '-', '-', '-', '092fe0f9d2be24108fb1f754fda8bda9')
Duplicate entry '' for key 2


Is it temporary hosting error or anyone else???

38
Discussion & Troubleshooting / Fix a hits. Need help
« on: June 27, 2010, 10:59:57 AM »
Good Day to all.

Please, say me, why... when my users or guests refresh his images, it count hits!!! How to use cookies or something like this, that to count only one time?

Thanks!

39
Good Day!

Anyone can help me?

I need to show one or two users name on the main page sort by default every refresh page. Please help me with this..

Thx!

40
Hi Mr`s Guru of php,

Anybody can help me?

It is possible, to send value, from upload form field to dropdown menu automatic? Thereby to do auto-generated dropdown. I need to do something like that.

Thanks :?:

41
I was developed it for my site and i want to give this mod to all...

Description:

This mod will autamatically apply watermark on all your images. It may be show at your desicion. This MOD will not affect on image quality!

Installation Level:    Easy
Installation Time:      5 Minutes

New files:
_watermark
watermark.png
.htaccess

1. Create a _watermark.php and put this code in this file:
Code: [Select]
<?

waterMark($_SERVER['DOCUMENT_ROOT'].$_SERVER['REQUEST_URI'], "watermark.png", "top=20,center=");

function waterMark($original, $watermark, $placement = 'middle=5, center=50', $destination = null) {
   $original = urldecode($original);
   $info_o = @getImageSize($original);
   if (!$info_o)
         return false;
   $info_w = @getImageSize($watermark);
   if (!$info_w)
         return false;

   list ($vertical, $horizontal) = split(',', $placement,2);
   list($vertical, $sy) = split('=', trim($vertical),2);
   list($horizontal, $sx) = split('=', trim($horizontal),2);

   switch (trim($vertical)) {
      case 'bottom':
         $y = $info_o[1] - $info_w[1] - (int)$sy;
         break;
      case 'middle':
         $y = ceil($info_o[1]/2) - ceil($info_w[1]/2) + (int)$sy;
         break;
      default:
         $y = (int)$sy;
         break;
      }

   switch (trim($horizontal)) {
      case 'right':
         $x = $info_o[0] - $info_w[0] - (int)$sx;
         break;
      case 'center':
         $x = ceil($info_o[0]/2) - ceil($info_w[0]/2) + (int)$sx;
         break;
      default:
         $x = (int)$sx;
         break;
      }

   header("Content-Type: ".$info_o['mime']);

   $original = @imageCreateFromString(file_get_contents($original));
   $watermark = @imageCreateFromString(file_get_contents($watermark));
   $out = imageCreateTrueColor($info_o[0],$info_o[1]);

   imageCopy($out, $original, 0, 0, 0, 0, $info_o[0], $info_o[1]);
   if( ($info_o[0] > 250) && ($info_o[1] > 250) )
   {
   imageCopy($out, $watermark, $x, $y, 0, 0, $info_w[0], $info_w[1]);
   }

   switch ($info_o[2]) {
      case 1:
         imageGIF($out);
         break;
      case 2:
         imageJPEG($out, NULL, 100);
         break;
      case 3:
         imagePNG($out);
         break;
         }

   imageDestroy($out);
   imageDestroy($original);
   imageDestroy($watermark);

   return true;
   }

?>

2. Create a picture, which you want to show as watermark with name watermark.png


3. Create directory with name watermark and put this 2 files into (_watermark.php and watermark.png) and upload this to the root directory

4. Create a .htaccess file with this code and put this file to data/:
In case if you have a validation on you site put this file to data/tmp_media,
In case if you have a straight upload on you site put this file to data/media/(category which you want watermarked),
Upload this file to all directories (data/media/[all directories] and tmp_media) if you want watermark all you images from database
Code: [Select]
DirectoryIndex index.php
 
<FilesMatch "\.(gif|jpg|png|JPG)$">
   RewriteEngine On
   RewriteCond %{REQUEST_FILENAME} -f
   RewriteRule ^(.*)$ /watermark/_watermark.php [T=application/x-httpd-php,L,QSA]
</FilesMatch>

DEMO:

42
Please help me with this. I have many languages of my site. But now i need to do that it show "eng" part in the URL. How to do this?

43
Programming / Count hits of images
« on: May 15, 2010, 09:09:57 PM »
Good day to all...

If i will reload page hits will be count. I need to do check it by IP. One IP, one hit...

Help me please!

Thanks!

44
Good day to all.

If respected Admins will decide that this is the MOD. Replace this to Mods & Plugins (Releases & Support) topic.

Description:

This mod will show you photos by three days, last week, last 30 days and last year since current date.

Installation:


1. In search.php
find:
Code: [Select]
if ($search_new_images && $show_result == 1) {
  $search_id['search_new_images'] = 1;
}

add after:
Code: [Select]
if ($search_new_images == 3) {
  $search_id['search_new_images'] = 3;
}
if ($search_new_images == 7) {
  $search_id['search_new_images'] = 7;
}
if ($search_new_images == 30) {
  $search_id['search_new_images'] = 30;
}
if ($search_new_images == 365) {
  $search_id['search_new_images'] = 365;
}

1.2 find:
Code: [Select]
if (!empty($search_id['search_new_images']) && $search_id['search_new_images'] == 1) {
    $new_cutoff = time() - 60 * 60 * 24 * $config['new_cutoff'];
    $sql_where_query .= "AND i.image_date >= $new_cutoff ";
  }

add after:
Code: [Select]
  if (!empty($search_id['search_new_images']) && $search_id['search_new_images'] == 3) {
    $new_cutoff = time() - 60 * 60 * 24 * 3;
    $sql_where_query .= "AND i.image_date >= $new_cutoff";
  }
 
    if (!empty($search_id['search_new_images']) && $search_id['search_new_images'] == 7) {
    $new_cutoff = time() - 60 * 60 * 24 * 7;
    $sql_where_query .= "AND i.image_date >= $new_cutoff";
  }
 
    if (!empty($search_id['search_new_images']) && $search_id['search_new_images'] == 30) {
    $new_cutoff = time() - 60 * 60 * 24 * 30;
    $sql_where_query .= "AND i.image_date >= $new_cutoff";
  }
 
    if (!empty($search_id['search_new_images']) && $search_id['search_new_images'] == 365) {
    $new_cutoff = time() - 60 * 60 * 24 * 365;
    $sql_where_query .= "AND i.image_date >= $new_cutoff";
  }

2. In includes/page_header:
find:
Code: [Select]
"url_new_images" => $site_sess->url(ROOT_PATH."search.php?search_new_images=1"),
add after:
Code: [Select]
"url_new_images_tree" => $site_sess->url(ROOT_PATH."search.php?search_new_images=3"),
    "url_new_images_week" => $site_sess->url(ROOT_PATH."search.php?search_new_images=7"),
      "url_new_images_month" => $site_sess->url(ROOT_PATH."search.php?search_new_images=30"),
        "url_new_images_year" => $site_sess->url(ROOT_PATH."search.php?search_new_images=365"),

3. In home.html:
insert when you need:
Code: [Select]
<a href="<?=$site_sess->url(ROOT_PATH."search.php?search_new_images=3")?>"><b>Last 3 Days Photos</b></a>&nbsp;
<a href="<?=$site_sess->url(ROOT_PATH."search.php?search_new_images=7")?>"><b>Last 7 Days Photos</b></a>&nbsp;
<a href="<?=$site_sess->url(ROOT_PATH."search.php?search_new_images=30")?>"><b>Last 30 Days Photos</b></a>&nbsp;
<a href="<?=$site_sess->url(ROOT_PATH."search.php?search_new_images=365")?>"><b>Last 365 Days Photos</b></a>&nbsp;


This is all..

ONE QUESTION. Anyone have idea how it realize to sort by image hits????

45
Mods & Plugins (Requests & Discussions) / Show input info after upload
« on: April 05, 2010, 08:56:17 AM »
Hi all

Anyone know, it is possible to show filling informaton from fields, after upload photo. On page where uploaded photo show.

For example:

User fill info in fields: Country (USA), Date (12/12/09)
I need to show this info after uloading photo on member.php

Anyone can help me?

Pages: 1 2 [3] 4