Menu
Forums
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Trending
What's new
New posts
New profile posts
Latest activity
Members
Current visitors
New profile posts
Search profile posts
Upgrades
Log in
Register
What's new
Search
Search
Search titles only
By:
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
Server Development
Habbo Retros
Habbo Q&A
[HELP] Tags with RevCMS
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="achtrey" data-source="post: 122385" data-attributes="member: 18947"><p>So here's the deal.. I've been looking everywhere for a tags add-on for my hotel, and I finally found one.</p><p> </p><p>Here's the script, Coded by Spartak <a href="http://devbest.com/members/devbest.2801/" target="_blank">DevBest</a> by the way. my question is under the script - so don't forget to scroll!</p><p> </p><p>[CODE]<?php</p><p>$my_id = $_SESSION['user']['id'];</p><p>$fetch_tags = mysql_query("SELECT tag,id FROM user_tags WHERE user_id = '".$my_id."' LIMIT 20") or die(mysql_error());</p><p>$tags_num = mysql_num_rows($fetch_tags);</p><p> </p><p> $randomq[] = "What is your favourite food?";</p><p> $randomq[] = "Who is your favourite actor?";</p><p> $randomq[] = "What kind of music do you like?";</p><p> $randomq[] = "What is your favourite sport?";</p><p> $randomq[] = "Who is your favourite actress?";</p><p> $randomq[] = "What is your favourite colour?";</p><p> $randomq[] = "What is your favourite band?";</p><p> $randomq[] = "What is your favourite TV show?";</p><p> $randomq[] = "Which football team do you support?";</p><p> $randomq[] = "What is your favourite football team?";</p><p> $randomq[] = "Your favourite cartoon?";</p><p> $randomq[] = "What is your favourite video game?";</p><p> $randomq[] = "What's your favourite pastime?";</p><p> $randomq[] = "What kind of mood are you in right now?";</p><p> $randomq[] = "What is your favourite movie?";</p><p> $randomq[] = "What is your favourite time of year?";</p><p> </p><p>srand ((double) microtime() * 1000000);</p><p>$chosen = rand(0,count($randomq)-1);</p><p> </p><p>$tag_question = $randomq[$chosen];</p><p> </p><p>if( $_GET['do'] ) {</p><p> $do = $_GET['do'];</p><p> mysql_query("DELETE FROM user_tags WHERE id = '".$do."'");</p><p> Redirect("me");</p><p>}</p><p> </p><p> if (isset($_POST['newtag']))</p><p> {</p><p> $user_id = $_SESSION['user']['id'];</p><p> $tag = htmlspecialchars(addslashes($_POST[newtag]));</p><p> </p><p> if (strlen($user_id) < 1 || strlen($tag) < 1)</p><p> {</p><p> Redirect("me");</p><p> }</p><p> else</p><p> {</p><p> mysql_query("INSERT INTO user_tags (user_id ,tag) VALUES ('" . $user_id . "','" . $tag . "')");</p><p> Redirect("me");</p><p> }</p><p> } ?></p><p> </p><p> <HTML><div class="content-box-radio"></p><p><div class="habblet-container "></p><p> <ul class="box-tabs"></p><p> <li id="tab-3-2" class="selected"><a href="#">My Tags</a><span class="tab-spacer"></span></li></p><p> </ul></p><p> <br /></p><p> <a href="me" class="tab-ajax"></a></p><p> </div></p><p> <div id="tab-3-2-content" ></p><p> <div id="my-tag-info" class="habblet-content-info"></p><p> <?php if($tags_num > 19){ echo "Max limit tag.delete one of your tag and then add."; } elseif($tags_num == 0){ echo "You dont have tag. Answere the question or make ur own."; } elseif($tags_num < 20){ echo "u dident use all of ur tags. Add more!"; } ?></p><p> </div></p><p><div class="box-content"></p><p> <div class="habblet" id="my-tags-list"></p><p> </p><p><?php if($tags_num > 0){</p><p> echo "<ul class=\"tag-list make-clickable\"> ";</p><p> while($row = mysql_fetch_assoc($fetch_tags)){</p><p> echo " <li><a href=\"tags?tag=".strtolower($row['tag'])."\" class=\"tag\" style=\"font-size:10px\">".strtolower($row['tag'])."</a></p><p> <a href='?do=".$row['id']."' title=\"delete tag\"><img src='{url} /app/tpl/skins/habbo/images/tags/redminus.gif' /></a></li>";</p><p> }</p><p> echo "</ul>";</p><p>} ?></p><p> </p><p><?php if($tags_num < 20){ ?></p><p> <form method="post"></p><p> <div class="add-tag-form clearfix"></p><p> <button type="submit" class="positive" name="submitcomment">OK</button></p><p> <input type="text" name="newtag" id="add-tag-input" maxlength="20" style="float: left"/></p><p> <em class="tag-question"><?php echo $tag_question; ?></em></p><p> </div></p><p> <div style="clear: both"></div></p><p> </form></p><p><?php } ?></p><p> </div></p><p></div></p><p> </p><p><script type="text/javascript"></p><p>document.observe("dom:loaded", function() {</p><p> TagHelper.setTexts({</p><p> tagLimitText: "you have reached your tag limit - delete 1 if you want to add new one.",</p><p> invalidTagText: "Invalid tag",</p><p> buttonText: "OK"</p><p> });</p><p> TagHelper.init('21063711');</p><p>});</p><p></script></p><p></div></p><p></HTML>[/CODE]</p><p> </p><p> </p><p>I put the script in me.php in a little box i made, and this is how it turns out <a href="http://i.imgur.com/bNU1u.png" target="_blank">http://i.imgur.com/bNU1u.png</a></p><p> </p><p>I can add tags, but when I do, it redirects me to a wierd looking site, which is supposed to be "/me" I think.. <a href="http://i.imgur.com/6JfKj.png" target="_blank">http://i.imgur.com/6JfKj.png</a>,</p><p>When this happens, i have to refresh /me to get to the normal site where the tag is now added.</p><p>Also, you can't remove tags, like at all..</p><p>I've tried removing the box, but it looks exactly the same apart from that the box is gone. Lol captain.obvious!</p><p> </p><p>Anyways, if someone knows how to fix this, i'd really appreciate it!</p><p>THanks in advance!!</p></blockquote><p></p>
[QUOTE="achtrey, post: 122385, member: 18947"] So here's the deal.. I've been looking everywhere for a tags add-on for my hotel, and I finally found one. Here's the script, Coded by Spartak [URL='http://devbest.com/members/devbest.2801/']DevBest[/URL] by the way. my question is under the script - so don't forget to scroll! [CODE]<?php $my_id = $_SESSION['user']['id']; $fetch_tags = mysql_query("SELECT tag,id FROM user_tags WHERE user_id = '".$my_id."' LIMIT 20") or die(mysql_error()); $tags_num = mysql_num_rows($fetch_tags); $randomq[] = "What is your favourite food?"; $randomq[] = "Who is your favourite actor?"; $randomq[] = "What kind of music do you like?"; $randomq[] = "What is your favourite sport?"; $randomq[] = "Who is your favourite actress?"; $randomq[] = "What is your favourite colour?"; $randomq[] = "What is your favourite band?"; $randomq[] = "What is your favourite TV show?"; $randomq[] = "Which football team do you support?"; $randomq[] = "What is your favourite football team?"; $randomq[] = "Your favourite cartoon?"; $randomq[] = "What is your favourite video game?"; $randomq[] = "What's your favourite pastime?"; $randomq[] = "What kind of mood are you in right now?"; $randomq[] = "What is your favourite movie?"; $randomq[] = "What is your favourite time of year?"; srand ((double) microtime() * 1000000); $chosen = rand(0,count($randomq)-1); $tag_question = $randomq[$chosen]; if( $_GET['do'] ) { $do = $_GET['do']; mysql_query("DELETE FROM user_tags WHERE id = '".$do."'"); Redirect("me"); } if (isset($_POST['newtag'])) { $user_id = $_SESSION['user']['id']; $tag = htmlspecialchars(addslashes($_POST[newtag])); if (strlen($user_id) < 1 || strlen($tag) < 1) { Redirect("me"); } else { mysql_query("INSERT INTO user_tags (user_id ,tag) VALUES ('" . $user_id . "','" . $tag . "')"); Redirect("me"); } } ?> <HTML><div class="content-box-radio"> <div class="habblet-container "> <ul class="box-tabs"> <li id="tab-3-2" class="selected"><a href="#">My Tags</a><span class="tab-spacer"></span></li> </ul> <br /> <a href="me" class="tab-ajax"></a> </div> <div id="tab-3-2-content" > <div id="my-tag-info" class="habblet-content-info"> <?php if($tags_num > 19){ echo "Max limit tag.delete one of your tag and then add."; } elseif($tags_num == 0){ echo "You dont have tag. Answere the question or make ur own."; } elseif($tags_num < 20){ echo "u dident use all of ur tags. Add more!"; } ?> </div> <div class="box-content"> <div class="habblet" id="my-tags-list"> <?php if($tags_num > 0){ echo "<ul class=\"tag-list make-clickable\"> "; while($row = mysql_fetch_assoc($fetch_tags)){ echo " <li><a href=\"tags?tag=".strtolower($row['tag'])."\" class=\"tag\" style=\"font-size:10px\">".strtolower($row['tag'])."</a> <a href='?do=".$row['id']."' title=\"delete tag\"><img src='{url} /app/tpl/skins/habbo/images/tags/redminus.gif' /></a></li>"; } echo "</ul>"; } ?> <?php if($tags_num < 20){ ?> <form method="post"> <div class="add-tag-form clearfix"> <button type="submit" class="positive" name="submitcomment">OK</button> <input type="text" name="newtag" id="add-tag-input" maxlength="20" style="float: left"/> <em class="tag-question"><?php echo $tag_question; ?></em> </div> <div style="clear: both"></div> </form> <?php } ?> </div> </div> <script type="text/javascript"> document.observe("dom:loaded", function() { TagHelper.setTexts({ tagLimitText: "you have reached your tag limit - delete 1 if you want to add new one.", invalidTagText: "Invalid tag", buttonText: "OK" }); TagHelper.init('21063711'); }); </script> </div> </HTML>[/CODE] I put the script in me.php in a little box i made, and this is how it turns out [URL]http://i.imgur.com/bNU1u.png[/URL] I can add tags, but when I do, it redirects me to a wierd looking site, which is supposed to be "/me" I think.. [URL]http://i.imgur.com/6JfKj.png[/URL], When this happens, i have to refresh /me to get to the normal site where the tag is now added. Also, you can't remove tags, like at all.. I've tried removing the box, but it looks exactly the same apart from that the box is gone. Lol captain.obvious! Anyways, if someone knows how to fix this, i'd really appreciate it! THanks in advance!! [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
Server Development
Habbo Retros
Habbo Q&A
[HELP] Tags with RevCMS
Top