Mysidia Adoptables Support Forum

Mysidia Adoptables Support Forum (http://www.mysidiaadoptables.com/forum/index.php)
-   Addons/Mods Graveyard (http://www.mysidiaadoptables.com/forum/forumdisplay.php?f=41)
-   -   Adopts News (http://www.mysidiaadoptables.com/forum/showthread.php?t=881)

Bloodrun 06-01-2009 08:31 AM

RE: Adopts News
 
Quote:

Originally Posted by Saphira
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 =/

Saphira 06-01-2009 09:00 AM

RE: Adopts News
 
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.

Bloodrun 06-01-2009 09:12 AM

RE: Adopts News
 
Quote:

Originally Posted by Saphira
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 =/

Saphira 06-01-2009 09:56 AM

RE: Adopts News
 
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.

Bloodrun 06-01-2009 09:57 AM

RE: Adopts News
 
Quote:

Originally Posted by Saphira
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

Saphira 06-01-2009 10:15 AM

RE: Adopts News
 
Exactly the same. If you want I can link you to the test site where I'm trying to fix this.

BMR777 06-01-2009 10:33 AM

RE: Adopts News
 
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.

Bloodrun 06-01-2009 10:35 AM

RE: Adopts News
 
Quote:

Originally Posted by BMR777
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

Saphira 06-01-2009 10:52 AM

RE: Adopts News
 
I used
PHP Code:

<?
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?

BMR777 06-01-2009 11:12 AM

RE: Adopts News
 
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.

Saphira 06-01-2009 06:29 PM

RE: Adopts News
 
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 Code:

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

I've been trying to add somewhere:

PHP Code:

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 Code:

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

BMR777 06-01-2009 06:37 PM

RE: Adopts News
 
If you just want to have only admins and news editors edit the page, do this:

PHP Code:

if($isloggedin == "yes"){

$mygroup getgroup();

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

// Do your stuff here

}



In this line:

PHP Code:

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. :)

Saphira 06-01-2009 07:14 PM

RE: Adopts News
 
I had to change that a lil' bit, but I got it to work. :D

Finished code:

PHP Code:

$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)

Bloodrun 06-01-2009 07:16 PM

RE: Adopts News
 
Quote:

Originally Posted by Saphira
I had to change that a lil' bit, but I got it to work. :D

Finished code:

PHP Code:

$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

Saphira 06-01-2009 07:55 PM

RE: Adopts News
 
Haha thank you. now all I need to do is figure out that pesky aspostrophe. ¬.¬

The triforce power shall help me! Â â–²
                                           ▲ –²

Bloodrun 06-01-2009 07:58 PM

RE: Adopts News
 
Quote:

Originally Posted by Saphira
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 >.<

Saphira 06-01-2009 08:02 PM

RE: Adopts News
 
I know what forum you're referring to, but I was referring to Zelda. =P

Quote:

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.

Saphira 06-02-2009 08:13 AM

RE: Adopts News
 
IDIDITIDIDITIDIDIT!

PHP Code:

// 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!

trollis76 06-02-2009 11:11 AM

RE: Adopts News
 
Quote:

Originally Posted by Saphira
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.

Saphira 06-02-2009 11:29 AM

RE: Adopts News
 
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

Bloodrun 06-02-2009 12:58 PM

RE: Adopts News
 
Quote:

Originally Posted by Saphira
IDIDITIDIDITIDIDIT!

PHP Code:

// 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!

What did you do?

Quote:

Originally Posted by Saphira
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

o.0 Boy was I wrong.

Saphira 06-02-2009 03:36 PM

RE: Adopts News
 
Quote:

Originally Posted by Bloodrun
What did you do?

PHP Code:

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

in add_reply.php

Bloodrun 06-02-2009 05:52 PM

RE: Adopts News
 
Quote:

Originally Posted by Saphira
Quote:

Originally Posted by Bloodrun
What did you do?

PHP Code:

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

in add_reply.php

Ahh very well.

Saphira 06-04-2009 04:08 PM

RE: Adopts News
 
Okay, last step that I'm struggling on to get this perfected. I want the users in user group 6 to be able to delete news as well as admins, so if they mess up when they post, they don't have to wait for me to come online to delete it. I've tried 5 or 6 different things to get this to work, and nothing has yet. :S Any help? =^.^=

Bloodrun 06-04-2009 08:35 PM

RE: Adopts News
 
Quote:

Originally Posted by Saphira
Okay, last step that I'm struggling on to get this perfected. I want the users in user group 6 to be able to delete news as well as admins, so if they mess up when they post, they don't have to wait for me to come online to delete it. I've tried 5 or 6 different things to get this to work, and nothing has yet. :S Any help? =^.^=

I have to warn you about this, if you give them the option, that means all the responses will be lost as well.

Doing this will require a new page, and it will also require that you not only delete the news part, but the replies as well.

zhiichiro 06-09-2009 02:36 AM

RE: Adopts News
 
on the site_news.php, i click the add_news.php. i try to post a news, but when i try to add news, it's ERROR..

i also try the add_reply.php but it says error, contact administrator (bloodrun)


i just uploaded the files on the file manager of my site.. where the other php's are..

Bloodrun 06-09-2009 09:21 AM

RE: Adopts News
 
Well what error are you getting?
Did you follow the instructions step by step?
Did you tinker with the files?
Are you sure your MySql tables are in the correct database?

zhiichiro 06-09-2009 10:37 PM

RE: Adopts News
 
i just follow what you said on your first post. and i didnt do anything more.

about the error.. it simply says "ERROR" on mysite/add_news.php

zhiichiro 06-15-2009 12:19 PM

RE: Adopts News
 
i did it!yeay, this is cool!!

btw, is it possible to add new mod that is like this, but nut news, i want to make 1 for "games"

Bloodrun 06-15-2009 04:07 PM

RE: Adopts News
 
Quote:

Originally Posted by zhiichiro
i did it!yeay, this is cool!!

btw, is it possible to add new mod that is like this, but nut news, i want to make 1 for "games"

Um, just make a news report about games..

SubZ 06-16-2009 11:27 PM

RE: Adopts News
 
Eeep, I got this working on Suffering Spooks but it's not going as well on Rhypets.

The page is at http://www.rhypets.com/V2/news.php?nid=1 as as you can see it screws up the template quite a bit. It's only that page that does it, all the other ones in this mod work fine with my template.

Here's my template if you need it...

Code:

                                                                                                                                      <head>
<title>Rhypets</title>
<link rel="stylesheet" href="/V2/templates/Green/css.css" type="text/css">
</head>
 
<body>

<div id="frame">

<div id="header">
<img src="http://www.rhypets.com/layoutnew/bannertop.png">

<div id="header-stat">

</div>

</div>

<div id="NEWS">
<a href="/extrapage.php">NEWS<br>
...one of our new version launch pets is just going to...</a>
</div>


<div id="navside2">
<img src="http://www.rhypets.com/layoutnew/bannerside.png">

<div id="navbar">
<a href="index.php" class=nav>Home</a><br>
<a href="adopt.php" class=nav>Adopt</a><br>
<a href="myadopts_level.php" class=nav>My Portal</a><br>
<a href="account.php" class=nav>My Account</a><br>
<a href="messages.php" class=nav>RhyMail</a><br>
<a href="stats.php" class=nav>Top 10 Pets</a><br>
    <a href="register.php" class=nav>Register</a><br>
    <a href="logout.php" class=nav>Logout</a><br>
    <a href="tos.php" class=nav>ToS</a><br>
</div>


</div>

<div id="content">
<table style="border: 2px #000000 solid;width:500px;background-color:#FFF;">
<tr>
<td style="background-image:
    url('http://www.rhypets.com/layoutnew/tablebg.jpg'); background-repeat: no-repeat; border:2px #000000 solid;">
<b><center><font color=#FFFFFF>Rhypets!</font></b></center>
</td>
</tr>
<tr>
<td style="height:620px;">
<div id="rightcontent">
:ARTICLETITLE:<p>
:ARTICLECONTENT:
</div>
</td>
</tr>
</table>
<p>

<div id="copyadd">
<table>
<tr>
<td>
----Removed the google add code here----
</td>
</tr>
<tr>
<p>

<td style="background-image:
    url('http://www.rhypets.com/layoutnew/tablebg.jpg'); background-repeat:repeat; border:2px #000000 solid;width:670px;">
<b><center><font color=#FFFFFF>

<!-- Start FreeOnlineUsers.com -->
<a href="http://www.freeonlineusers.com">
<script type="text/javascript" src="http://st1.freeonlineusers.com/on4.php?id=151830"> </script> Online Users</a>
<!-- End FreeOnlineUsers.com --><br>

Copyright 2008 - Subzero Ninja Productions
</center></font></b></center>
</td>
</tr>
</table>
<center>
<a href="http://www.verpets.com/register.php?refer=Subzeroace"><img src="http://www.verpets.com/images/banners/deathbutton.gif" border="0" /></a> 
<a href="http://www.sufferingspooks.com/"><img src="http://www.sufferingspooks.com/img/banner1.gif" border="0"></a>
<a href="http://www.vpnwars.com/meteor/vpn/redir/signup/?ra=4528"><img src="http://www.rhypets.com/img/vpn.gif" border="0"></a>
</div>

</body>
</html>


Bloodrun 06-18-2009 02:13 PM

RE: Adopts News
 
Quote:

Originally Posted by SubZ
Eeep, I got this working on Suffering Spooks but it's not going as well on Rhypets.

The page is at http://www.rhypets.com/V2/news.php?nid=1 as as you can see it screws up the template quite a bit. It's only that page that does it, all the other ones in this mod work fine with my template.

Here's my template if you need it...

Code:

                                                                                                                                      <head>
<title>Rhypets</title>
<link rel="stylesheet" href="/V2/templates/Green/css.css" type="text/css">
</head>
 
<body>

<div id="frame">

<div id="header">
<img src="http://www.rhypets.com/layoutnew/bannertop.png">

<div id="header-stat">

</div>

</div>

<div id="NEWS">
<a href="/extrapage.php">NEWS<br>
...one of our new version launch pets is just going to...</a>
</div>


<div id="navside2">
<img src="http://www.rhypets.com/layoutnew/bannerside.png">

<div id="navbar">
<a href="index.php" class=nav>Home</a><br>
<a href="adopt.php" class=nav>Adopt</a><br>
<a href="myadopts_level.php" class=nav>My Portal</a><br>
<a href="account.php" class=nav>My Account</a><br>
<a href="messages.php" class=nav>RhyMail</a><br>
<a href="stats.php" class=nav>Top 10 Pets</a><br>
    <a href="register.php" class=nav>Register</a><br>
    <a href="logout.php" class=nav>Logout</a><br>
    <a href="tos.php" class=nav>ToS</a><br>
</div>


</div>

<div id="content">
<table style="border: 2px #000000 solid;width:500px;background-color:#FFF;">
<tr>
<td style="background-image:
    url('http://www.rhypets.com/layoutnew/tablebg.jpg'); background-repeat: no-repeat; border:2px #000000 solid;">
<b><center><font color=#FFFFFF>Rhypets!</font></b></center>
</td>
</tr>
<tr>
<td style="height:620px;">
<div id="rightcontent">
:ARTICLETITLE:<p>
:ARTICLECONTENT:
</div>
</td>
</tr>
</table>
<p>

<div id="copyadd">
<table>
<tr>
<td>
----Removed the google add code here----
</td>
</tr>
<tr>
<p>

<td style="background-image:
    url('http://www.rhypets.com/layoutnew/tablebg.jpg'); background-repeat:repeat; border:2px #000000 solid;width:670px;">
<b><center><font color=#FFFFFF>

<!-- Start FreeOnlineUsers.com -->
<a href="http://www.freeonlineusers.com">
<script type="text/javascript" src="http://st1.freeonlineusers.com/on4.php?id=151830"> </script> Online Users</a>
<!-- End FreeOnlineUsers.com --><br>

Copyright 2008 - Subzero Ninja Productions
</center></font></b></center>
</td>
</tr>
</table>
<center>
<a href="http://www.verpets.com/register.php?refer=Subzeroace"><img src="http://www.verpets.com/images/banners/deathbutton.gif" border="0" /></a> 
<a href="http://www.sufferingspooks.com/"><img src="http://www.sufferingspooks.com/img/banner1.gif" border="0"></a>
<a href="http://www.vpnwars.com/meteor/vpn/redir/signup/?ra=4528"><img src="http://www.rhypets.com/img/vpn.gif" border="0"></a>
</div>

</body>
</html>


Well for one you dont have a closing </P> around :ARTICLECONTENT:

This is why I don't suggest, that if you are new to HTML, that you use a template like this.


All times are GMT -5. The time now is 09:07 PM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.