Просмотр поста

.
jimy
Добавлено: 01.07.2017 / 08:05
# EMINEM (23.06.2017 / 21:15)
jimy, An excellent function, is there a script that will make this function work?
Why is there no archive /page/?
for page/?act=tag I made I myself u can make new directory / just use existing directory and change the link as you want, mine is for example.
to get the hashtag
<a href="'.$homeurl.'/page/?act=tags&amp;src='.$tg.'" title="'._t('In-Tags: '.$tags[0].'','system').'">

Добавлено: 01.07.2017 / 08:13
for example #hastag I request its from table discus (nb: u can use forum/news/guestbook/etc.)

table
DROP TABLE IF EXISTS `discus`;
CREATE TABLE `discus` (
  `id`	INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
  `time`	INT(10) UNSIGNED NOT NULL DEFAULT '0',
  `user_id`	int(10) unsigned NOT NULL DEFAULT '0',
  `name` TEXT	NOT NULL,
  `text` TEXT	NOT NULL,
  `close` TINYINT(3) UNSIGNED NOT NULL DEFAULT '0',
  `tag_name`    VARCHAR(250)     NOT NULL DEFAULT '',
  PRIMARY KEY (`id`),
  KEY `user_id` (`user_id`),
  KEY `tag_name` (`tag_name`)
)
  ENGINE = MyISAM
  DEFAULT CHARSET = utf8mb4;


code in /page/?act=tags
/* mod HashTag system by jimy ironyzm */
	/* author: jimy */
$rev = $db->query("SELECT * FROM `discus` WHERE `tag_name` = '".$src."'")->fetch();
if($src != $rev['tag_name']){
	$url = '?act=tags';
	header('refresh:5;url='.$url.'');
	echo '<div class="menu">Sorry Tags Not-Found or Maybe Deleted! <hr/> u\'ll redirect in 5 sec.</div>';
	require('../system/end.php');
	exit;
}
	/* mod HashTag system by jimy ironyzm */
	/* author: jimy */
if(empty($src) || $src != $rev['tag_name']){
	$reg = $db->query("SELECT * FROM `discus` GROUP BY `tag_name` ORDER BY `id`");
	if ($reg->rowCount()) {
		echo '<div class="menu">';
		while ($rez = $reg->fetch()) {
			$usage = $db->query("SELECT COUNT(*) FROM `discus` WHERE `tag_name` = '".$rez['tag_name']."'")->fetchColumn();
			echo '<a href="../page/?act=tags&amp;src='.$rez['tag_name'].'" title="'._t('In-Tags: #'.$rez['tag_name'].'','system').'"><span class="tagcon">'.$rez['tag_name'].' = '.
				 $usage.'</span></a>';
				++$i;
		}
		echo '</div>';
	} else {
		echo '<div class="menu center"><b>'._t('No Tags!','system').'</b></div>';
	}
}

_______________________

Только русский и английский!