Magazin Shop

840
.
This is a remake of the file magazin.php i have found on this site.
Works for johncms 7++
Feel free to add any modification
Instalation:
Just create new folder in root of the site and put this file in it.
After,add a link to it in mainmenu.php
Прикрепленные файлы:
.
What is it for? Please
.
For karma , change status and remove ban history
.
How about users sharing there point, cod with admin function to share point for all users too, and admin ability to close and open the sharing page.
.
jimy
# citybooks (09.06.2017 / 18:24)
How about users sharing there point, cod with admin function to share point for all users too, and admin ability to close and open the sharing page.
maybe like this,
.''")->fetchColumn();

/* executor */
if (isset($_POST['submit'])) {
	$error = [];
	$point = isset($_POST['point']) ? trim($_POST['point']) : false;
	if (empty($_POST['text'])) {
		$error['point'][] = _t('You cant send empty point!','system');
	}
	if ($point >= $pointgiver) {
		$error['point'][] = _t('You cant send more than your point!','system');
	}
	if ($user['id'] == $systemUser->id) {
		$error['point'][] = _t('You cant send to your self!','system');
	}
	$flood = $tools->antiflood();
	if ($flood) {
		$error['flood'][] = sprintf(_t('You cannot add point so often. Please, wait %d seconds.','system'), $flood);
	}
	/* update data for receiver */
	if (!$error) {
		$receive = $pointreceive + $point;
		$db->prepare('
		UPDATE `point` SET
			`total` = ?
			WHERE `user` = ?
		')->execute([
			$receive,
			$user['id'],
		]);
	}
	
	/* update data for giver */
	if (!$error) {
		$given = $pointgiver - $point;
		$db->prepare('
		UPDATE `point` SET
			`total` = ?
			WHERE `user` = ?
		')->execute([
			$given,
			$user['id'],
		]);
	}
	$db->query("OPTIMIZE TABLE `point`");
}

/* form (edit form action) */
echo '<form action="?" method="post" name="form">'.
	(isset($error['flood']) ? '<p class="red">'.implode($error['flood']).'</p>' : '').
	(isset($error['point']) ? '<p class="red">'.implode($error['point']).'</p>' : '');
echo '<p>Point giver</p>';
echo '<p><input type="number" name="point" value="'.$point.'"/></p>';
echo '<input type="submit" name="submit" value="'._t('Send','system').'"/></form>';
.
jimy
cek file for comple example
Прикрепленные файлы:
.
# jimy (14.06.2017 / 09:09)
maybe like this,
.''")->fetchColumn();

/* executor */
if (isset($_POST['submit'])) {
$error = [];
$point = isset($_POST['point']) ? trim($_POST['point']) : false;
if (empty($_POST['text']))
Not working properly for me, http://kinsvilla.com.ng
.
# citybooks (16.06.2017 / 01:22)
Not working properly for me, http://kinsvilla.com.ng
that's for example, learn the structure only, check every sql request
.
# jimy (01.07.2017 / 08:42)
that's for example, learn the structure only, check every sql request
Can u help me fix it? An new to it bro
Всего: 9