Adopts News

Forum
Last Post
Threads / Messages
Saphira said:
Yeah it is weird. I just tried uploading a fresh add_news.php, to see if it would change anything, and nada. Still nothing. The problem was posting articles with single quotes in lol.

Yeah that's making no sense to make o.0 I have even test it out on mine, with nothing but single quotes, no problem =/
 
I don't get a problem posting articles with just ''''''''''''''' in, they go in fine. It's when I use stuff like "I'm, I'll, Bloodrun's, Saphira's, BMR's" etc.
 
Saphira said:
I don't get a problem posting articles with just ''''''''''''''' in, they go in fine. It's when I use stuff like "I'm, I'll, Bloodrun's, Saphira's, BMR's" etc.

That doesnt make since though, because the stripsplash should take care of that =/
 
I've just done a completely fresh install of both the adoptables script, and of the news script. I'm getting the exact same error. The only thing I've changed in the whole thing is the detail section in the database from varchar to LONGTEXT.
 
Saphira said:
I've just done a completely fresh install of both the adoptables script, and of the news script. I'm getting the exact same error. The only thing I've changed in the whole thing is the detail section in the database from varchar to LONGTEXT.

Try just making it varchar, and make it a really number like, 10,000
 
Exactly the same. If you want I can link you to the test site where I'm trying to fix this.
 
Bloodrun, are you running the secure function twice on the data? That could potentially add two sets of quotes.

Also, is PHP Magic Quotes enabled on the server having this error? That may also cause issues as that automatically tries to escape data in some situations, which secure() takes care of.
 
BMR777 said:
Bloodrun, are you running the secure function twice on the data? That could potentially add two sets of quotes.

Also, is PHP Magic Quotes enabled on the server having this error? That may also cause issues as that automatically tries to escape data in some situations, which secure() takes care of.

Twice for the same function?
It might be possible Ill check.

The second thing, I believe your talking to Saphira, so yeah.. lol
 
I used
PHP:
<?
if(get_magic_quotes_gpc())
	echo "Magic quotes are on";
else
	echo "Magic quotes are off";
?>

To see if magic quotes were enabled or not on http://jonalicious.com/magic.php. Apparently they are off. Is this a problem?
 
No, if magic quotes are off that's fine. If they were on, which they are on by default on some real old PHP installs, that could account for double slashes on ' marks and thus why the single quotes would not appear correctly.

Since they are off though the single quotes not appearing correctly is not caused by what I thought it might be.
 
Hmm. I'm trying to edit site_news.php so that the people who can post news are the user groups editors and admins. This is what I've been playing with:

PHP:
if($isLoggedin == "yes" and $cancp == "yes"){

I've been trying to add somewhere:

PHP:
if($group == "editor")

because I figure that will allow the editor usergroup to post, as well as admins. Though I've had no luck. I've also tried:

PHP:
if($isLoggedin == "yes" and $group == "editors" $cancp == "yes"){

But then I realised that the original line is checking that the user is logged in, and that their group can access the admin CP. It's all part of one function. That's what lead me to thinking if($group == "editor") might work, because it's a separate one. Though I've been having trouble fitting it in and getting it to work properly. :3
 
If you just want to have only admins and news editors edit the page, do this:

PHP:
if($isloggedin == "yes"){

$mygroup = getgroup();

if($cancp == "yes" or $mygroup = 5){

// Do your stuff here

}

}

In this line:

PHP:
if($cancp == "yes" or $mygroup = 5){

Change 5 to the numerical ID of the group you want to have access to the page. This will allow all users who can access the ACP as well as members of this group to access the page. :)
 
I had to change that a lil' bit, but I got it to work. :D

Finished code:

PHP:
$article_content = "".$msg."<br>".$article_content."";


$group = getgroup();

$cancp = cancp($group);


if($isloggedin == "yes"){

$mygroup = getgroup();

if($cancp == "yes" or $mygroup == 6){


$add = "<a href='create_news.php'>Add News</a>";

}

else{

$add = "";

}

}

Can someone pls confirm that I haven't just messed something up big time here? XD; (if you do I'll kill you for ruining my moment of elated-ness! =P)
 
Saphira said:
I had to change that a lil' bit, but I got it to work. :D

Finished code:

PHP:
$article_content = "".$msg."<br>".$article_content."";


$group = getgroup();

$cancp = cancp($group);


if($isloggedin == "yes"){

$mygroup = getgroup();

if($cancp == "yes" or $mygroup == 6){


$add = "<a href='create_news.php'>Add News</a>";

}

else{

$add = "";

}

}

Can someone pls confirm that I haven't just messed something up big time here? XD; (if you do I'll kill you for ruining my moment of elated-ness! =P)

There is one HUGE error..
Theres no me in it..
lol =P only kidding, nicely done. =D
 
Haha thank you. now all I need to do is figure out that pesky aspostrophe. ¬.¬

The triforce power shall help me!  ▲
                                            ▲ ▲
 
Saphira said:
Haha thank you. now all I need to do is figure out that pesky aspostrophe. ¬.¬

The triforce power shall help me!  ▲
                                            ▲ ▲

Oh no, not this forum too >.<
 
I know what forum you're referring to, but I was referring to Zelda. =P

The Triforce (トライフォース, Toraifōsu?) is a triangular relic which features throughout the series as a nearly-omnipotent sacred item representing the essences of the Golden Goddesses. It is made up of three smaller triangles known as the Triforce of Wisdom, Triforce of Power and Triforce of Courage. Each of these embody the essence of their respective goddess, and bestow certain boons on their bearers. As shown in The Legend of Zelda and The Wind Waker, each piece can be further subdivided, though they become powerless in this state.
 
IDIDITIDIDITIDIDIT!

PHP:
// Find highest answer number.
$query = "SELECT MAX(nid) AS Max_nid FROM ".$prefix."news";
$result = mysql_query($query);

	$Max_nid=@mysql_result($result,"Max_nid");

// add + 1 to highest answer number and keep it in variable name "$Max_id". if there no answer yet set it = 1
if ($result) {
$Max_idd = $Max_nid+1;
}
else {
$Max_idd = 1;
}


$topic = $_POST['topic'];
$topic = secure($topic);
$detail = $_POST['detail'];
$deatil = secure($detail);
$name = $_POST['name'];
$name = secure($name);
$datetime = date('d/m/y h:i:s');
$datetime = secure($datetime); //create date time

$topic = addslashes($topic);
$detail = addslashes($detail);

	$query = "INSERT INTO ".$prefix."news(topic, detail, name, nid, datetime) VALUES('".$topic."', '".$detail."', '".$name."', '".$Max_idd."', '".$datetime."')";
	$result = mysql_query($query);

I'm like, so happy right now. :p I was getting sick of writing "I'm testing using apostrophes." lol.

WHO'S THE MAN!
 
Saphira said:
WHO'S THE MAN!

Well... Not you, I guess. Since you're not a man and-
*Just kidding*

But wai- Are you a man? I just guessed by the name but... I might be wrong? Congratz, for solving this anyway.
 
I am male. Saphira is the name of my favourite fictional character of all time. She's the beautiful dragon from Eragon/Eldest/Brisingr. =P
 

Similar threads

Users who are viewing this thread

  • Forum Contains New Posts
  • Forum Contains No New Posts

Forum statistics

Threads
4,277
Messages
33,118
Members
1,602
Latest member
BerrieMilk
BETA

Latest Threads

Latest Posts

Top