Temos pavadinimas: WordPress, Shopify ir PHPFusion programuotojų bendruomenė :: dovanu sistema
Parašė suomis· 2009 Vas. 13 16:02:19
#1
kaip istraukt is to modo tokius dalykus :
vartotojas suomis gavai dovanu: 4
padovanojai dovanu: 0
?|
Parašė ex-it· 2009 Vas. 13 16:02:51
#2
uzklausas daryt, tai yra dbcountus :)
Redagavo ex-it· 2009 Vas. 13 16:02:17
Parašė suomis· 2009 Vas. 13 16:02:06
#3
kad zinociau kokius daryt ?|
Parašė MAnjack· 2009 Vas. 13 16:02:33
#4
Parodyk truktūrą lentelės, parašysiu.
Parašė suomis· 2009 Vas. 13 16:02:39
#5
ten dauk tu failu cia yra show_gif.php:
<?php
/*---------------------------------------------------+
| PHP-Fusion 6 Content Management System
+----------------------------------------------------+
| Copyright © 2002 - 2006 Nick Jones
| http://www.php-fusion.co.uk/
+----------------------------------------------------+
| Released under the terms & conditions of v2 of the
| GNU General Public License. For details refer to
| the included gpl.txt file or visit http://gnu.org
+----------------------------------------------------*/
require_once "../../maincore.php";
require_once BASEDIR."subheader.php";
require_once BASEDIR."side_left.php";
include INFUSIONS."sf_gift_system/includes/functions.php";
// Check if locale file is available matching the current site locale setting.
if (file_exists(INFUSIONS."sf_gift_system/locale/".LOCALESET."/show_gift.php")) {
// Load the locale file matching the current site locale setting.
include INFUSIONS."sf_gift_system/locale/".LOCALESET."/show_gift.php";
} else {
// Load the infusion's default locale file.
include INFUSIONS."sf_gift_system/locale/English/show_gift.php";
}
if (!isset($lookup)) $lookup = "";
$result = dbquery("SELECT * FROM ".$db_prefix."sf_gift_given WHERE gift_given_id='$gift_id'");
$data = dbarray($result);
$lookup = $data['gift_given_to'];
if ($lookup == $userdata['user_id']) {
$access = "2";
} else {
$access = "1";
}
if ((isset($gift_id)) && (isNum($gift_id))) {
opentable($locale['sfgift300']);
$result = dbquery("SELECT * FROM ".$db_prefix."sf_gift_given WHERE gift_given_id='$gift_id' AND gift_given_visibillity<='$access' ORDER BY gift_given_id");
$rows = dbrows($result);
if ($rows != 0) {
$data = dbarray($result);
$gift = dbarray(dbquery("SELECT * FROM ".$db_prefix."sf_gift WHERE gift_id='".$data['gift_given_gift_id']."'"));
$from = dbarray(dbquery("SELECT * FROM ".$db_prefix."users WHERE user_id='".$data['gift_given_from']."'"));
$to = dbarray(dbquery("SELECT * FROM ".$db_prefix."users WHERE user_id='".$data['gift_given_to']."'"));
echo "<table cellpadding='0' cellspacing='0' width='100%'>
<tr>
<td class='tbl' align='center'><a href='".GIFT_SYSTEM."show_all.php?lookup=".$to['user_id']."'>".$locale['sfgift320']." ".$to['user_name']."'s ".$locale['sfgift321']."</a></td>
<td class='tbl' align='center'><a href='".BASEDIR."profile.php?lookup=".$to['user_id']."'>".$locale['sfgift320']." ".$to['user_name']."'s ".$locale['sfgift322']."</a></td>";
if ($userdata['user_id'] != $to['user_id']) {
echo "<td class='tbl' align='center'><a href='".GIFT_SYSTEM."brows_gifts.php?user_id=".$to['user_id']."'>".$locale['sfgift323']." ".$to['user_name']."</a></td>";
$colspan = "3";
} else {
$colspan = "2";
}
echo "</tr>
<tr>
<td colspan='".$colspan."'><hr></td>
</tr>
</table>";
echo "<table cellpadding='0' cellspacing='0' width='100%'>
<tr>
<td align='center' valign='top' width='100px' rowspan='3'><img src='".GIFT_IMAGES.$gift['gift_image']."' alt='".$gift['gift_image']."' style='border:0px;'></td>";
if (($data['gift_given_visibillity'] == "1") && ($data['gift_given_to'] != $userdata['user_id'])) {
echo "<td><h2>".$locale['sfgift301']."</td>";
} else {
echo "<td><h2>".$locale['sfgift302']." ".$from['user_name']."</td>";
}
echo "</tr>
<tr>
<td>";
if ($data['gift_given_visibillity'] == "0") {
echo "<b>".$locale['sfgift303']."</b><br>".$locale['sfgift304']."";
} else if ($data['gift_given_visibillity'] == "1") {
echo "<b>".$locale['sfgift305']."</b><br>".$locale['sfgift306']."";
} else if ($data['gift_given_visibillity'] == "2") {
echo "<b>".$locale['sfgift307']."</b><br>".$locale['sfgift308']."";
}
echo "</td>
</tr>";
if ($data['gift_given_message'] != "") {
echo "<tr>
<td><br><br><img src='quote.gif' alt='' align='top'> ".$data['gift_given_message']." <img src='quote.gif' alt='' align='bottom'></td>
</tr>";
}
echo "</table>";
} else {
echo "<center><br>".$locale['sfgift309']."<br><br>\n</center>\n";
}
closetable();
} else {
redirect(BASEDIR."index.php");
}
require_once BASEDIR."side_right.php";
require_once BASEDIR."footer.php";
?>
cia infusion.php failas dovanu sistemos :
<?php
/*---------------------------------------------------+
| PHP-Fusion 6 Content Management System
+----------------------------------------------------+
| Copyright © 2002 - 2005 Nick Jones
| http://www.php-fusion.co.uk/
+----------------------------------------------------+
| Released under the terms & conditions of v2 of the
| GNU General Public License. For details refer to
| the included gpl.txt file or visit http://gnu.org
+----------------------------------------------------*/
if (!defined("IN_FUSION") || !checkrights("I")) { header("Location: ../../index.php"); exit; }
// Check if locale file is available matching the current site locale setting.
if (file_exists(INFUSIONS."sf_gift_system/locale/".LOCALESET."/infusion.php")) {
// Load the locale file matching the current site locale setting.
include INFUSIONS."sf_gift_system/locale/".LOCALESET."/infusion.php";
} else {
// Load the infusion's default locale file.
include INFUSIONS."sf_gift_system/locale/English/infusion.php";
}
include INFUSIONS."sf_gift_system/includes/upgrade_functions.php";
// Infusion general information
$inf_title = $locale['sfgift100'];
$inf_description = $locale['sfgift101'];
$inf_version = $myversion;
$inf_developer = "Starefossen";
$inf_email = "hans@starefossen.com";
$inf_weburl = "http://www.starsheaven.com";
$inf_folder = "sf_gift_system"; // The folder in which the infusion resides.
$inf_admin_image = "sf_gift_system.gif"; // Leave blank to use the default image.
$inf_admin_panel = "admin.php"; // The admin panel filename if required.
$inf_link_name = $locale['sfgift100']; // if not required replace $locale['xxx102']; with "";
$inf_link_url = "brows_gifts.php"; // The filename you wish to link to.
$inf_link_visibility = "101"; // 0 - Guest / 101 - Member / 102 - Admin / 103 - Super Admin.
$inf_newtables = 3; // Number of new db tables to create or drop.
$inf_insertdbrows = 1; // Numbers rows added into created db tables.
$inf_altertables = 0; // Number of db tables to alter (upgrade).
$inf_deldbrows = 0; // Number of db tables to delete data from.
// Delete any items not required here.
$inf_newtable_[1] = "sf_gift (
gift_id INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
gift_image VARCHAR(200) NOT NULL,
gift_price INT(11) UNSIGNED NOT NULL,
gift_stock INT(11) UNSIGNED NOT NULL,
gift_bought INT(11) UNSIGNED NOT NULL,
PRIMARY KEY (gift_id)
) TYPE=MyISAM;";
$inf_newtable_[2] = "sf_gift_version (
gift_version_id INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
gift_version varchar(10) NOT NULL default '".$myversion."',
PRIMARY KEY (gift_version_id)
) TYPE=MyISAM;";
$inf_newtable_[3] = "sf_gift_given (
gift_given_id INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
gift_given_gift_id INT(11) UNSIGNED NOT NULL,
gift_given_from INT(11) UNSIGNED NOT NULL,
gift_given_to INT(11) UNSIGNED NOT NULL,
gift_given_visibillity INT(1) UNSIGNED NOT NULL DEFAULT '0',
gift_given_message TEXT NOT NULL,
PRIMARY KEY (gift_given_id)
) TYPE=MyISAM;";
$inf_insertdbrow_[1] = "sf_gift_version (gift_version_id, gift_version) VALUES('', '".$myversion."')";
$inf_droptable_[1] = "sf_gift";
$inf_droptable_[3] = "sf_gift_version";
$inf_droptable_[2] = "sf_gift_given";
?>
Redagavo suomis· 2009 Vas. 13 16:02:49
Parašė ex-it· 2009 Vas. 13 16:02:46
#6
gift_given_from - nuo ko dovana
gift_given_to - kam dovanojo :D
viskas pasidaryk
number_format(dbcount("(*)", "sf_gift_given", "gift_given_to='".$userdata['user_id']."'"))
cia kiek gavai dovanu :D
va tokio kazkas :D
Parašė suomis· 2009 Vas. 13 16:02:09
#7
kazkas ar veiks? :D
Parašė ex-it· 2009 Vas. 13 16:02:30
#8
tai pamegink nu
Parašė suomis· 2009 Vas. 13 16:02:20
#9
veikia aciu :) +10