You're looking for some 4images templates and styles? Then visit this thread to show websites with 4images templates to download.
0 Members and 1 Guest are viewing this topic.
I have the same code like :DB Error: Bad SQL Query: INSERT INTO 4images_voted (user_id, image_id, vote) VALUES (, 12, 3)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 ' 12, 3)' at line 4 and my table on myphpadmin is like:----------------------------------------------------## Tablo yapısı : `4images_voted`#DROP TABLE IF EXISTS `4images_voted`;CREATE TABLE `4images_voted` ( `user_id` mediumint( unsigned NOT NULL default '0', `image_id` mediumint( unsigned NOT NULL default '0', `vote` int(2) unsigned NOT NULL default '0', KEY `user_id` (`user_id`), KEY `image_id` (`image_id`)) ENGINE=MyISAM DEFAULT CHARSET=latin1;whats wrong?NOTE: I had already installed "more and more statistics MOD" before this mod.
Sorry, redo steps 1 and 2.2
[qcode]CREATE TABLE `4images_voted` ( `id` mediumint( NOT NULL auto_increment, `user_id` mediumint( unsigned NOT NULL default '0', `image_id` mediumint( unsigned NOT NULL default '0', `vote` int(2) unsigned NOT NULL default '0', `date` int(11) NOT NULL default '0', PRIMARY KEY (`id`), KEY `user_id` (`user_id`), KEY `image_id` (`image_id`)) ENGINE=MyISAM;[/qcode]
define('VOTED_TABLE', $table_prefix.'voted');
Here is a little addon for version A of this mod which I promised for a long time and never published it...It will show who voted and if u logged in as admin also show what was the vote of each voted member on image details page (details.php)Step 1Open details.phpFind:Code: [Select]//-----------------------------------------------------//--- Print Out ---------------------------------------//-----------------------------------------------------Insert above:Code: [Select]//-----------------------------------------------------//--- Voted stats -------------------------------------//-----------------------------------------------------$sql = "SELECT v.user_id, v.vote, u.user_name FROM ".VOTED_TABLE." v LEFT JOIN ".USERS_TABLE." u ON (u.user_id = v.user_id) WHERE u.user_id = v.user_id AND image_id = ".$image_id;$result = $site_db->query($sql);$voted_list = "";while ($row = $site_db->fetch_array($result)){ $vote = ($user_info['user_level'] == ADMIN) ? " (".$row['vote'].")" : ""; $voted_list .= "<a href=\"".$site_sess->url(ROOT_PATH."member.php?action=showprofile&user_id=".$row['user_id'])."\">".$row['user_name']."</a>".$vote."<br />"; //member name WITH a link to their profile page// $voted_list .= $row['user_name'].$vote."<br />"; //member name WITHOUT a link to their profile page}$site_template->register_vars(array( "voted_list" => $voted_list, "lang_voted_list" => $lang['voted_list']));//----- End Voted stats ----------------Step 2In lang/<your language>/main.php at the very end, above closing ?> insert:Code: [Select]$lang['voted_list'] = "Who voted";Step 3In templates/<your template>/details.html use the following tags:{lang_voted_list} - this will show text "Who voted"{voted_list} - this will show the list of members who has votedP.S. if you installed a mod that changed details.php and that alteres $image_id variable, this mod might not work properly!
//-----------------------------------------------------//--- Print Out ---------------------------------------//-----------------------------------------------------
//-----------------------------------------------------//--- Voted stats -------------------------------------//-----------------------------------------------------$sql = "SELECT v.user_id, v.vote, u.user_name FROM ".VOTED_TABLE." v LEFT JOIN ".USERS_TABLE." u ON (u.user_id = v.user_id) WHERE u.user_id = v.user_id AND image_id = ".$image_id;$result = $site_db->query($sql);$voted_list = "";while ($row = $site_db->fetch_array($result)){ $vote = ($user_info['user_level'] == ADMIN) ? " (".$row['vote'].")" : ""; $voted_list .= "<a href=\"".$site_sess->url(ROOT_PATH."member.php?action=showprofile&user_id=".$row['user_id'])."\">".$row['user_name']."</a>".$vote."<br />"; //member name WITH a link to their profile page// $voted_list .= $row['user_name'].$vote."<br />"; //member name WITHOUT a link to their profile page}$site_template->register_vars(array( "voted_list" => $voted_list, "lang_voted_list" => $lang['voted_list']));//----- End Voted stats ----------------
$lang['voted_list'] = "Who voted";
$vote = ($user_info['user_level'] == ADMIN) ? " (".$row['vote'].")" : "";
$vote = " (".$row['vote'].")";
Correct, thats because this mod does not change the way 4images stores the total votes/rating, its being saved into 4images_images table for each image individualy. So, what you see at top page, is the information stored in 4images_images table.