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

Pages: [1] 2 3 4 5 ... 21
1
Discussion & Troubleshooting / To much query time. I need help
« on: January 22, 2015, 04:25:40 PM »
I cant understand, where is the problem. Below is log file of my requests

# Time: 141202  1:54:51
# User@Host: drandrew[drandrew] @ localhost [127.0.0.1]
# Thread_id: 6673171  Schema: drandrew  Last_errno: 1005  Killed: 1053
# Query_time: 191.102375  Lock_time: 0.000000  Rows_sent: 0  Rows_examined: 0  Rows_affected: 0  Rows_read: 1
# Bytes_sent: 66  Tmp_tables: 0  Tmp_disk_tables: 0  Tmp_table_sizes: 0
use drandrew;
SET timestamp=1417474491;
CREATE TABLE IF NOT EXISTS 5images_users_rating (
        
field_id int(11unsigned NOT NULL AUTO_INCREMENT,
        
user_ids int(11NOT NULL DEFAULT '0',
        
other_user_id int(11NOT NULL DEFAULT '0',
        
rating_date int(11NOT NULL DEFAULT '0',        
        
rating_value int(2NOT NULL DEFAULT '0',
        
rating_count int(11NOT NULL DEFAULT '0',
        
PRIMARY KEY(field_id)
        ) 
TYPE=MyISAM;
# Time: 141202  1:54:51
# User@Host: drandrew[drandrew] @ localhost [127.0.0.1]
# Thread_id: 6673174  Schema: drandrew  Last_errno: 1005  Killed: 1053
# Query_time: 190.411156  Lock_time: 0.000000  Rows_sent: 0  Rows_examined: 0  Rows_affected: 0  Rows_read: 1
# Bytes_sent: 66  Tmp_tables: 0  Tmp_disk_tables: 0  Tmp_table_sizes: 0
SET timestamp=1417474491;
CREATE TABLE IF NOT EXISTS 5images_users_rating (
        
field_id int(11unsigned NOT NULL AUTO_INCREMENT,
        
user_ids int(11NOT NULL DEFAULT '0',
        
other_user_id int(11NOT NULL DEFAULT '0',
        
rating_date int(11NOT NULL DEFAULT '0',        
        
rating_value int(2NOT NULL DEFAULT '0',
        
rating_count int(11NOT NULL DEFAULT '0',
        
PRIMARY KEY(field_id)
        ) 
TYPE=MyISAM;
# Time: 141202  1:54:51
# User@Host: drandrew[drandrew] @ localhost [127.0.0.1]
# Thread_id: 6673222  Schema: drandrew  Last_errno: 1005  Killed: 1053
# Query_time: 174.069439  Lock_time: 0.000000  Rows_sent: 0  Rows_examined: 0  Rows_affected: 0  Rows_read: 1
# Bytes_sent: 66  Tmp_tables: 0  Tmp_disk_tables: 0  Tmp_table_sizes: 0
use drandrew;
SET timestamp=1417474491;
CREATE TABLE IF NOT EXISTS 5images_users_rating (
        
field_id int(11unsigned NOT NULL AUTO_INCREMENT,
        
user_ids int(11NOT NULL DEFAULT '0',
        
other_user_id int(11NOT NULL DEFAULT '0',
        
rating_date int(11NOT NULL DEFAULT '0',        
        
rating_value int(2NOT NULL DEFAULT '0',
        
rating_count int(11NOT NULL DEFAULT '0',
        
PRIMARY KEY(field_id)
        ) 
TYPE=MyISAM;
# Time: 141202  1:54:51
# User@Host: drandrew[drandrew] @ localhost [127.0.0.1]
# Thread_id: 6673259  Schema: drandrew  Last_errno: 1005  Killed: 0
# Query_time: 147.307311  Lock_time: 0.000000  Rows_sent: 0  Rows_examined: 0  Rows_affected: 0  Rows_read: 1
# Bytes_sent: 66  Tmp_tables: 0  Tmp_disk_tables: 0  Tmp_table_sizes: 0
use drandrew;
SET timestamp=1417474491;
CREATE TABLE IF NOT EXISTS 5images_users_rating (
        
field_id int(11unsigned NOT NULL AUTO_INCREMENT,
        
user_ids int(11NOT NULL DEFAULT '0',
        
other_user_id int(11NOT NULL DEFAULT '0',
        
rating_date int(11NOT NULL DEFAULT '0',        
        
rating_value int(2NOT NULL DEFAULT '0',
        
rating_count int(11NOT NULL DEFAULT '0',
        
PRIMARY KEY(field_id)
        ) 
TYPE=MyISAM;


What does this process mean?

2
May i see the site for more information? Send me link via PM

3
Please, post your ajaxrating.php code here

4
Sorry! I missed!

Find:
Code: [Select]
if ($action == "rateimage" && $id) {add below:
Code: [Select]
  if ($user_info['user_level'] != GUEST) {
    $sql = "SELECT user_id, image_id, vote
            FROM ".VOTED_TABLE."
            WHERE image_id = ".$id." AND user_id = ".$user_info['user_id'];
    $rated = $site_db->query_firstrow($sql);
    $rating = ($rated['vote']) ? $rated['vote'] : $rating;
  }else{
    $rated = FALSE;
  }

-------------------

Code: [Select]
$rating = floatval($HTTP_POST_VARS['rating']);
Must be under the code!

5
Due to some MOD restrictions, you will be able to show only one result using stars images! (See attachments for DEMO!!!)

However, you able to show extremely results in ratung values (not in images)!

Let`s go!

0. STEP. Make a backup all files will be changed!!!

1. Step
Correct 4images_voted table. Set new options on "vote" Type: decimal Length/value 4,2 As defined  0.00

2. Step
Add to the 4images_voted table new field "vote_time" int(11) No 0
3. Step
Open /includes/page_header.php and delete:
Code: [Select]
 if ($user_info['user_level'] != GUEST) {
    $sql = "SELECT user_id, image_id, vote
            FROM ".VOTED_TABLE."
            WHERE image_id = ".$id." AND user_id = ".$user_info['user_id'];
    $rated = $site_db->query_firstrow($sql);
    $rating = ($rated['vote']) ? $rated['vote'] : $rating;
  }else{
    $rated = FALSE;
  }
3.1 Step
At the very end Locate:
Code: [Select]
?>Add:
Code: [Select]
//-----------------------------------------------------
//--- LATEST VOTES ------------------------------------
//-----------------------------------------------------
$lastvoted = "";

        
        $sql = "SELECT v.user_id, v.image_id, v.vote, v.vote_time, u.user_id, u.user_name, i.image_id, i.image_name
        FROM ".VOTED_TABLE." v, ".USERS_TABLE." u, ".IMAGES_TABLE." i
        WHERE v.user_id = u.user_id AND v.image_id = i.image_id
        ORDER BY v.vote_time DESC
        LIMIT 1";


$result = $site_db->query($sql);  
   while ($row = $site_db->fetch_array($result)) {
  
$lastv = '<div id="star"><br style="clear: both;" /><ul id="star0" class="star"><li id="starCur0" class="curr" title="'.$row['vote'].'" style="width: 0px;"></li></ul></div>';
  
$lastvoted .= "<tr>";
$lastvoted .= "<td align=\"left\" width=\"4\"></td>";
$lastvoted .= "<td align=\"left\">";
$lastvoted .= '<a href ="'.ROOT_PATH.'search.php?search_user='.$row['user_name'].'"><b>'.$row['user_name'].'</b></a>';
$lastvoted .= "</td>";
$lastvoted .= "<td width=\"50\" align=\"right\">";
$lastvoted .= ''.$lastv.''.$row['image_name'].'';
$lastvoted .= "</td>";
$lastvoted .= "</tr>";
}

$site_template->register_vars(array(
"lastvoted" => $lastvoted,
));
unset($lastvoted);
//-----------------------------------------------------

4. Step

Open /ajaxrating.php and find:
Code: [Select]
 if ($action == "rateimage" && $id) {
Add below:
Code: [Select]
 if ($user_info['user_level'] != GUEST) {
    $sql = "SELECT user_id, image_id, vote
            FROM ".VOTED_TABLE."
            WHERE image_id = ".$id." AND user_id = ".$user_info['user_id'];
    $rated = $site_db->query_firstrow($sql);
    $rating = ($rated['vote']) ? $rated['vote'] : $rating;
  }else{
    $rated = FALSE;
  }

4.1 Step
Find:
Code: [Select]
if (!in_array($id, $split_list) && !in_array($id, $cookie_rated)) {Replace:
Code: [Select]
if (!in_array($id, $split_list) && !in_array($id, $cookie_rated) && !$rated) {
5 Step
Open /includes/functions.php:
Find:
Code: [Select]
function update_image_rating($image_id, $rating) {
  global $site_db, $user_info;
Add below:
Code: [Select]
$current_time = time();
5.1 Step
Find:
Code: [Select]
       $sql = "INSERT INTO ".VOTED_TABLE."
                (user_id, image_id, vote)
                VALUES
                (".$user_info['user_id'].", ".$image_id.", ".$rating.")";
        $site_db->query($sql);
Replace:
Code: [Select]
       $sql = "INSERT INTO ".VOTED_TABLE."
                (user_id, image_id, vote, vote_time)
                VALUES
                (".$user_info['user_id'].", ".$image_id.", ".$rating.", ".$current_time.")";
        $site_db->query($sql);

6. Step:
Open templates/details.html
Find and delete:
Code: [Select]
<!-- ----------------------------------------------- -->
<!-- [MOD] Ajax Star Rating -------------- by Bash-T -->
<!-- START ----------------------------------------- -->
<script type="text/javascript">
YAHOO.namespace('rating');
YAHOO.rating.star={
display_percentage : false, //set to true if a percentaged value shall be shown beneath the stars.
display_lables: true, //set to true if a ranking label shall be displayed beneath the stars at mouseover.
//do not modify the properties below!
num : 0,
successfully_voted : false,
labels : [ '{ajax_rating_labels_0}' , '{ajax_rating_labels_1}', '{ajax_rating_labels_2}', '{ajax_rating_labels_3}', '{ajax_rating_labels_4}', '{ajax_rating_labels_5}'],
msgs : [ '{ajax_rating_messages_0}' , '{ajax_rating_messages_1}', '{ajax_rating_messages_2}']
};
</script>
<script type="text/javascript" src="scripts/ajaxrating.js"></script>
<!-- ----------------------------------------------- -->
<!-- [MOD] Ajax Star Rating -------------- by Bash-T -->
<!-- END ----------------------------------------- -->

6.1 Step:
Open templates/header.html
Find:
Code: [Select]
<!-- ----------------------------------------------- -->
<!-- [MOD] Ajax Star Rating -------------- by Bash-T -->
<!-- START ----------------------------------------- -->
<script type="text/javascript" src="scripts/yui/2.7.0/build/yahoo-dom-event/yahoo-dom-event.js"></script>
<script type="text/javascript" src="scripts/yui/2.7.0/build/json/json-min.js"></script>
<script type="text/javascript" src="scripts/yui/2.7.0/build/connection/connection-min.js"></script>
<!-- ----------------------------------------------- -->
<!-- [MOD] Ajax Star Rating -------------- by Bash-T -->
And replace:
Code: [Select]
<!-- ----------------------------------------------- -->
<!-- [MOD] Ajax Star Rating -------------- by Bash-T -->
<!-- START ----------------------------------------- -->
<script type="text/javascript" src="scripts/yui/2.7.0/build/yahoo-dom-event/yahoo-dom-event.js"></script>
<script type="text/javascript" src="scripts/yui/2.7.0/build/json/json-min.js"></script>
<script type="text/javascript" src="scripts/yui/2.7.0/build/connection/connection-min.js"></script>

<script type="text/javascript">
YAHOO.namespace('rating');
YAHOO.rating.star={
display_percentage : false, //set to true if a percentaged value shall be shown beneath the stars.
display_lables: true, //set to true if a ranking label shall be displayed beneath the stars at mouseover.
//do not modify the properties below!
num : 0,
successfully_voted : false,
labels : [ '{ajax_rating_labels_0}' , '{ajax_rating_labels_1}', '{ajax_rating_labels_2}', '{ajax_rating_labels_3}', '{ajax_rating_labels_4}', '{ajax_rating_labels_5}'],
msgs : [ '{ajax_rating_messages_0}' , '{ajax_rating_messages_1}', '{ajax_rating_messages_2}']
};
</script>
<script type="text/javascript" src="scripts/ajaxrating.js"></script>
<!-- ----------------------------------------------- -->
<!-- [MOD] Ajax Star Rating -------------- by Bash-T -->
<!-- END ----------------------------------------- -->

7. Step
Open templates/home.html
And locate this, where you want:
Code: [Select]
             <TABLE border="0" cellpadding="5" cellspacing="0" width="400" class="tablehead">
                <tr>
                  <TD class="tdhead">Last vote</TD>
                </tr>
                <TR>
                  <TD>Recent voted photo</TD>
                </TR>
                {lastvoted}
              </TABLE>

In case you want to show rating values:

In step: 3.1 find:
Code: [Select]
//-----------------------------------------------------
//--- LATEST VOTES ------------------------------------
//-----------------------------------------------------
$lastvoted = "";

        
        $sql = "SELECT v.user_id, v.image_id, v.vote, v.vote_time, u.user_id, u.user_name, i.image_id, i.image_name
        FROM ".VOTED_TABLE." v, ".USERS_TABLE." u, ".IMAGES_TABLE." i
        WHERE v.user_id = u.user_id AND v.image_id = i.image_id
        ORDER BY v.vote_time DESC
        LIMIT 1";


$result = $site_db->query($sql);  
   while ($row = $site_db->fetch_array($result)) {
  
$lastv = '<div id="star"><br style="clear: both;" /><ul id="star0" class="star"><li id="starCur0" class="curr" title="'.$row['vote'].'" style="width: 0px;"></li></ul></div>';
  
$lastvoted .= "<tr>";
$lastvoted .= "<td align=\"left\" width=\"4\"></td>";
$lastvoted .= "<td align=\"left\">";
$lastvoted .= '<a href ="'.ROOT_PATH.'search.php?search_user='.$row['user_name'].'"><b>'.$row['user_name'].'</b></a>';
$lastvoted .= "</td>";
$lastvoted .= "<td width=\"50\" align=\"right\">";
$lastvoted .= ''.$lastv.''.$row['image_name'].'';
$lastvoted .= "</td>";
$lastvoted .= "</tr>";
}

$site_template->register_vars(array(
"lastvoted" => $lastvoted,
));
unset($lastvoted);
//-----------------------------------------------------
Replace:
Code: [Select]
//-----------------------------------------------------
//--- LATEST VOTES ------------------------------------
//-----------------------------------------------------
$lastvoted = "";

        
        $sql = "SELECT v.user_id, v.image_id, v.vote, v.vote_time, u.user_id, u.user_name, i.image_id, i.image_name
        FROM ".VOTED_TABLE." v, ".USERS_TABLE." u, ".IMAGES_TABLE." i
        WHERE v.user_id = u.user_id AND v.image_id = i.image_id
        ORDER BY v.vote_time DESC
        LIMIT 3";


$result = $site_db->query($sql);  
   while ($row = $site_db->fetch_array($result)) {
  
$lastv = ''.$row['vote'].'';
  
$lastvoted .= "<tr>";
$lastvoted .= "<td align=\"left\" width=\"4\"></td>";
$lastvoted .= "<td align=\"left\">";
$lastvoted .= '<a href ="'.ROOT_PATH.'search.php?search_user='.$row['user_name'].'"><b>'.$row['user_name'].'</b></a>';
$lastvoted .= "</td>";
$lastvoted .= "<td width=\"50\" align=\"right\">";
$lastvoted .= ''.$lastv.'';
$lastvoted .= "</td>";
$lastvoted .= "<td width=\"50\" align=\"right\">";
$lastvoted .= ''.$row['image_name'].'';
$lastvoted .= "</td>";
$lastvoted .= "</tr>";
}

$site_template->register_vars(array(
"lastvoted" => $lastvoted,
));
unset($lastvoted);
//-----------------------------------------------------


Additional info:
LIMIT 3 you may change as you need...

6
CodeMan, now STEP by STEP, to do next:

Before do steps below, make a backup, all files!! I strongly recommend you to do this!

1. Remove AJAX MOD, step by step from instructions from step 8 to 1
2. Check last installed rating mod, and do the same steps (Remove step by step)
3. Check, that default rating system work`s correctly reengaged and work
4. Step by step install AJAX rating again!

Be very careful with code!

7
CodeMan, I`ll try to help you...

Firstly, install this MOD: http://www.4homepages.de/forum/index.php?topic=6123.0

Important! Install variant "A" of the MOD. (A - will uses new table in the database)

When OK and checked, we will go next

8
CodeMan, at which pages do you want to show results? What result? Only voted image? Or all votes, maybe must voted??

9
Mods & Plugins (Requests & Discussions) / Re: Style für Mobiltelefone
« on: April 05, 2013, 02:56:21 PM »
Hello! I`ve a question...

if i install a second gallery to the http://www.deine_seite.de/iphone/, how i will show photos from first (http://www.deine_seite.de/data/...)? How to do this?

I can`t understand how to do next:

Quote
parallel 4image installation, it is better really parallel,.. which mean if you install your main in www.mysite.com/4image .. then you do the same install under www.mysite.com/4imagemobile.. site by site.. not under it.. so it is important for the fisrt main installation better not to install under the root site. .. You dont have to copy 'data' folder.. because came from the same db, and you take the data from main folder as you redirect it at constant.php

How to install?
What parameters during install?
What to do next?
Which files replace after?

Thanks!

10
Mods & Plugins (Releases & Support) / Re: [MOD] Ban v1.7
« on: March 24, 2013, 08:35:05 PM »
I`m sorry but:

Quote
This is a recent discover and its probably because your server has magic_quotes_gpc is turned on (check in phpinfo()).
To fix that, uncomment this line from includes/functions.php:
//  $ban_banned = stripslashes($ban_banned); //uncomment this line if magic_quotes_gpc is turned on on your server
Since v1.6.1 added auto check if magic_quotes_gpc is enabled

This solution was succesfully work for me, after fully uncomment  this line: $ban_banned = ($ban_banned) ? unserialize($ban_banned) : "";

Auto check is not work correctly

11
Discussion & Troubleshooting / &lang['example'] in new php. need help
« on: January 12, 2013, 10:40:59 PM »
Hello all! My problem is:

I`ve a php, in which describes some functions only. For the example i`ll post a part of the code

	
echo 
'<br><br><select name="drop_3" id="drop_3">
	
      <option value=" " disabled="disabled" selected="selected">Choose Example</option>
	
      <option value="unknown">Unknown</option>
	
      <option value="Type Manually Airline Here">Unlisted - Type Manually</option>
	
      <option value=" " disabled="disabled">---------------------</option>'
;


Choose Example, Unlisted - Type Manually, Unknown can`t support $lang['choose_example']... Got me error, lang is unknown... How to do this. Help me please! Many thanks!

12
Mods & Plugins (Releases & Support) / Re: [MOD] Support Ticket System
« on: November 02, 2012, 04:12:32 PM »
Please, tell me how to add additional fields? Thx!

13
Mods & Plugins (Releases & Support) / Re: [Mod] Multiupload V.3.1.1
« on: October 28, 2012, 07:32:47 PM »
Hm, very strange. Normal upload work`s fine. But multi-uplaod, with/without, original code from first post, not works. Only show IPTC date created!  :(

14
Mods & Plugins (Releases & Support) / Re: [Mod] Multiupload V.3.1.1
« on: October 28, 2012, 03:21:19 PM »
Rembrandt, I don`t know exactly why, but EXIF info had lost while uploading. Start Upload to Big folder may be caused? IPTC work`s good

15
I searched the entire forum and have not been able to find such a solution. Please, anyone help me with this. Click on the link, to open popup window with login fields...

Many thanks!

Pages: [1] 2 3 4 5 ... 21