Mysidia Adoptables Support Forum  

Home Community Mys-Script Creative Off-Topic
Go Back   Mysidia Adoptables Support Forum > Mysidia Adoptables > Questions and Supports

Notices

Reply
 
Thread Tools Display Modes
  #1  
Old 03-25-2010, 09:45 AM
jcga jcga is offline
Member
 
Join Date: Nov 2009
Posts: 15
Credits: 4,159
jcga
Default Problem

One person is doing Spamm in the Shoutbox of my adoptsite. I dont know how can stop it.

Im thinking if is possible hide some of the top button when you are Guest, for example the Shoutbox. THANKS
Reply With Quote
  #2  
Old 03-25-2010, 03:08 PM
BMR777 BMR777 is offline
Member
 
Join Date: Jan 2011
Posts: 1,122
Gender: Male
Credits: 17,104
BMR777 is on a distinguished road
Default RE: Problem

Is the user a guest? Only logged in members should have access to the shoutbox. Do you still want to hide the top link to the shoutbox to users that are not logged in?
Reply With Quote
  #3  
Old 03-26-2010, 02:22 AM
jcga jcga is offline
Member
 
Join Date: Nov 2009
Posts: 15
Credits: 4,159
jcga
Default RE: Problem

yes i want do it, and look my shoutbox:

Code:
<?php

// **********************************************************************
// Rusnak PHP Adoptables Script
// Copyright 2009 Brandon Rusnak
// For help and support: http://www.rusnakweb.com/forum/
//
// Redistribution prohibited without written permission
// **********************************************************************

// Wake the sleeping giant

// **********************************************************************
// Basic Configuration Info
// **********************************************************************

include("inc/functions.php");
include("inc/config.php");
include("inc/bbcode.php");

$themeurl = grabanysetting("themeurl");

// **********************************************************************
// Define our top links by calling getlinks()
// **********************************************************************

$links = getlinks();

// **********************************************************************
// Define our ads by calling getads()
// **********************************************************************

$ads = getads("any");

// **********************************************************************
// Grab any dynamic article content from the content table
// **********************************************************************

$pagecontent = getsitecontent("index");
$article_title = $pagecontent[title];
$article_content = $pagecontent[content];
$article_content = nl2br($article_content);

// **********************************************************************
// Grab any settings that we will need for the current page from the DB
// **********************************************************************

$browsertitle = grabanysetting("browsertitle");
$sitename = grabanysetting("sitename");
$slogan = grabanysetting("slogan");

// **********************************************************************
// Check and see if the user is logged in to the site
// **********************************************************************

$loginstatus = logincheck();
$isloggedin = $loginstatus[loginstatus];
$loggedinname = $loginstatus[username];

// **********************************************************************
// End Prepwork - Output the page to the user
// **********************************************************************

$article_title = "Shoutbox";
$article_content = "<p>Bienvenido a nuestro shoutbox. Si haces Doblepost, o haces publicidad de otra web, seras <b>baneado</b>, asi que no lo incumplais. Gracias.</p>";

$article_content = $article_content."<div class='enclosecomments'>";
$query = "SELECT * FROM ".$prefix."shoutbox ORDER BY id DESC LIMIT 0, 10";
$result = mysql_query($query);
$num = mysql_numrows($result);

//Loop out code
$i=0;
while ($i < $num) {
    $id=@mysql_result($result,$i,"id");
    $user=@mysql_result($result,$i,"user");
    $date=@mysql_result($result,$i,"date");
    $nolinecomment=@mysql_result($result,$i,"comment");
    $nolinecomment = bbconvert($nolinecomment);
    $comment=nl2br($nolinecomment);
    $commentdiv = "<div class='comment' style='width:94%;padding:2%;background-color:MidnightBlue;margin-bottom:5px;'><div class='userdate' style='width:50%;height:25px;color:red;'>".$user." - ".$date."</div>".$comment."</div>";
    $article_content = $article_content.$commentdiv;
    $i++;
}
$article_content = $article_content."</div><p>Escribe tu mensaje!</p>";
$article_content = $article_content."<form action='shoutbox.php' method='post'>
Aqui es donde tienes que escribir tu mensaje.
<textarea rows='15' cols='60' name='comment' wrap='physical' ></textarea><br>
<input type='submit' /></form>";

//here the user posts a comment
$comment = $_POST["comment"];
if ($comment != "") {
    $date = date("d-m-Y H:i:s");
    // $date = "3-23-10 21:02:35";
    $user = $loggedinname;
    if ($isloggedin!="yes") {
        $user = "Guest";
        }
    $comment = $comment;
    mysql_query("INSERT INTO ".$prefix."shoutbox VALUES ('', '$user', '$date', '$comment')");
    $article_content = $article_content."<p>Tu mensaje fue enviado. Haz click <a href='shoutbox.php'>aqui</a> para verlo.</p>";
}
else {
    $article_content = $article_content."";
    }
// **********************************************************************
// Begin Template Definition
// **********************************************************************

//Define our current theme
$file = $themeurl;

// Do the template changes and echo the ready template
$template = file_get_contents($file);

$template = replace(':ARTICLETITLE:',$article_title,$template);
$template = replace(':ARTICLECONTENT:',$article_content,$template);
$template = replace(':ARTICLEDATE:',$article_date,$template);

$template = replace(':BROWSERTITLE:',$browsertitle,$template);
$template = replace(':SITENAME:',$sitename,$template);

//Define our links
$template = replace(':LINKSBAR:',$links,$template);

//Get the content for the side bar...
$sidebar = getsidebar();
$template = replace(':SIDEFEED:',$sidebar,$template);

// Okay - now what we're going to do is get the style switchery thing


//Get the ad content...
$template = replace(':ADS:',$ads,$template);

//Get the slogan info
$template = replace(':SLOGAN:',$slogan,$template);


echo $template;

// **********************************************************************
// End Template Definition
// **********************************************************************
?>
Reply With Quote
  #4  
Old 03-26-2010, 11:30 AM
Arianna's Avatar
Arianna Arianna is offline
Dev Staff
 
Join Date: Sep 2009
Posts: 334
Gender: Female
Credits: 32,222
Arianna will become famous soon enough
Default RE: Problem

This would be my shoutbox, right? If so, you need to check for $loggedinname, and if !$loggediname, say that $article_content = "Guests cannot view." xD
Reply With Quote
  #5  
Old 03-26-2010, 04:47 PM
jcga jcga is offline
Member
 
Join Date: Nov 2009
Posts: 15
Credits: 4,159
jcga
Default RE: Problem

Yes i think is your Shoutbox but translated to Spanish.

Srry i dont know php, can someone give me the new code with the sigestion of Ariadna added?
Reply With Quote
  #6  
Old 03-27-2010, 02:35 AM
Arianna's Avatar
Arianna Arianna is offline
Dev Staff
 
Join Date: Sep 2009
Posts: 334
Gender: Female
Credits: 32,222
Arianna will become famous soon enough
Default RE: Problem

Here we go. (: Um, I had no idea how to say "Register to view and post" in Spanish, and what I added probably sounds stupid too, but either way, here it is. xD

PHP Code:
<?php

// **********************************************************************
// Rusnak PHP Adoptables Script
// Copyright 2009 Brandon Rusnak
// For help and support: http://www.rusnakweb.com/forum/
//
// Redistribution prohibited without written permission
// **********************************************************************

// Wake the sleeping giant

// **********************************************************************
// Basic Configuration Info
// **********************************************************************

include("inc/functions.php");
include(
"inc/config.php");
include(
"inc/bbcode.php");

$themeurl grabanysetting("themeurl");

// **********************************************************************
// Define our top links by calling getlinks()
// **********************************************************************

$links getlinks();

// **********************************************************************
// Define our ads by calling getads()
// **********************************************************************

$ads getads("any");

// **********************************************************************
// Grab any dynamic article content from the content table
// **********************************************************************

$pagecontent getsitecontent("index");
$article_title $pagecontent[title];
$article_content $pagecontent[content];
$article_content nl2br($article_content);

// **********************************************************************
// Grab any settings that we will need for the current page from the DB
// **********************************************************************

$browsertitle grabanysetting("browsertitle");
$sitename grabanysetting("sitename");
$slogan grabanysetting("slogan");

// **********************************************************************
// Check and see if the user is logged in to the site
// **********************************************************************

$loginstatus logincheck();
$isloggedin $loginstatus[loginstatus];
$loggedinname $loginstatus[username];

// **********************************************************************
// End Prepwork - Output the page to the user
// **********************************************************************

$article_title "Shoutbox";
$article_content "<p>Bienvenido a nuestro shoutbox. Si haces Doblepost, o haces publicidad de otra web, seras <b>baneado</b>, asi que no lo incumplais. Gracias.</p>";

if (
$isloggedin!="yes") {
    
$article_content "Guests no puede ver el Shoutbox.";
}
else {
    
$article_content $article_content."<div class='enclosecomments'>";
    
$query "SELECT * FROM ".$prefix."shoutbox ORDER BY id DESC LIMIT 0, 10";
    
$result mysql_query($query);
    
$num mysql_numrows($result);

    
//Loop out code
    
$i=0;
    while (
$i $num) {
        
$id=@mysql_result($result,$i,"id");
        
$user=@mysql_result($result,$i,"user");
        
$date=@mysql_result($result,$i,"date");
        
$nolinecomment=@mysql_result($result,$i,"comment");
        
$nolinecomment bbconvert($nolinecomment);
        
$comment=nl2br($nolinecomment);
        
$commentdiv "<div class='comment' style='width:94%;padding:2%;background-color:MidnightBlue;margin-bottom:5px;'><div class='userdate' style='width:50%;height:25px;color:red;'>".$user." - ".$date."</div>".$comment."</div>";
        
$article_content $article_content.$commentdiv;
        
$i++;
    }
    
$article_content $article_content."</div><p>Escribe tu mensaje!</p>";
    
$article_content $article_content."<form action='shoutbox.php' method='post'>
    Aqui es donde tienes que escribir tu mensaje.
    <textarea rows='15' cols='60' name='comment' wrap='physical' ></textarea><br>
    <input type='submit' /></form>"
;

    
//here the user posts a comment
    
$comment $_POST["comment"];
    if (
$comment != "") {
        
$date date("d-m-Y H:i:s");
        
// $date = "3-23-10 21:02:35";
        
$user $loggedinname;
        
$comment $comment;
        
mysql_query("INSERT INTO ".$prefix."shoutbox VALUES ('', '$user', '$date', '$comment')");
        
$article_content $article_content."<p>Tu mensaje fue enviado. Haz click <a href='shoutbox.php'>aqui</a> para verlo.</p>";
    }
}
// **********************************************************************
// Begin Template Definition
// **********************************************************************

//Define our current theme
$file $themeurl;

// Do the template changes and echo the ready template
$template file_get_contents($file);

$template replace(':ARTICLETITLE:',$article_title,$template);
$template replace(':ARTICLECONTENT:',$article_content,$template);
$template replace(':ARTICLEDATE:',$article_date,$template);

$template replace(':BROWSERTITLE:',$browsertitle,$template);
$template replace(':SITENAME:',$sitename,$template);

//Define our links
$template replace(':LINKSBAR:',$links,$template);

//Get the content for the side bar...
$sidebar getsidebar();
$template replace(':SIDEFEED:',$sidebar,$template);

// Okay - now what we're going to do is get the style switchery thing


//Get the ad content...
$template replace(':ADS:',$ads,$template);

//Get the slogan info
$template replace(':SLOGAN:',$slogan,$template);


echo 
$template;

// **********************************************************************
// End Template Definition
// **********************************************************************
?>
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 11:04 AM.

Currently Active Users: 5282 (0 members and 5282 guests)
Threads: 4,081, Posts: 32,032, Members: 2,016
Welcome to our newest members, jolob.
BETA





What's New?

What's Hot?

What's Popular?


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
vBCommerce I v2.0.0 Gold ©2010, PixelFX Studios
vBCredits I v2.0.0 Gold ©2010, PixelFX Studios
Emoticons by darkmoon3636