Log in

View Full Version : Adopts News


Bloodrun
05-27-2009, 05:16 PM
Well this was suggested by a member, so I'd thought I would give it a try.

Now everything works, but the look is very minimal, the reason I did it this is, is that you guys can make the colors and what not something that would fit your site.

Oh, and something else, with this one, you dont have to do any modifications, technically! =D

Just upload, and off you go.

Preview:
http://i43.tinypic.com/14lrbix.jpg
http://i39.tinypic.com/b6c4f5.jpg

Now just upload the files to where you adopts script is, and your set.
Once they are uploaded, go to
www.yoursite.com/site_news.php

And for the sql just import the sql files into your database.

[attachment=193][attachment=203]

SJC
05-27-2009, 05:35 PM
Wow, thats good :)

Bloodrun
05-27-2009, 05:41 PM
Wow, thats good :)


Lol, thanks =D

SJC
05-27-2009, 05:56 PM
The site_news.php file is not there.

Bloodrun
05-27-2009, 05:59 PM
The site_news.php file is not there.


Ooops, it's there now =D

SJC
05-27-2009, 06:03 PM
Hmm, not add_reply.php either.

Bloodrun
05-27-2009, 06:04 PM
Hmm, not add_reply.php either.


Jeese >.<

Okay its added

SJC
05-27-2009, 06:13 PM
Thats better :) And again great job.

Bloodrun
05-27-2009, 06:21 PM
Thats better :) And again great job.


Lol thanks again =D

Xius
05-27-2009, 06:41 PM
You aught to put some padding on those tables! The words are too close to the left side.

Bloodrun
05-27-2009, 06:45 PM
You aught to put some padding on those tables! The words are too close to the left side.


Lol like I said, I only made it so it works. The fashion is up to you guys.

Saphira
05-27-2009, 07:42 PM
Haha, another awesome job Bloodrun. It is very easily customisable, only problem I have is when I'm posting a news comment, for some reason I get an error if the detail field is too long. I have to go into the database and manually edit it. Any idea why?

SJC
05-27-2009, 07:57 PM
Whats the error?

Bloodrun
05-27-2009, 08:18 PM
Haha, another awesome job Bloodrun. It is very easily customisable, only problem I have is when I'm posting a news comment, for some reason I get an error if the detail field is too long. I have to go into the database and manually edit it. Any idea why?


Hmm in your database, go to your 'adopts_news' table and change the details type to longtext.

That should take care of the text limitation.

Saphira
05-27-2009, 08:40 PM
Yep. It's perfect now. Great job!

Bloodrun
05-27-2009, 08:42 PM
Yep. It's perfect now. Great job!


Lol thanks =D
Let me know if something doesn't work right, or if there's something you think should be added.

zhiichiro
05-28-2009, 05:24 AM
when i go to my site + site_news.php, and click add news, it will say ERROR??

Bloodrun
05-28-2009, 08:13 AM
when i go to my site + site_news.php, and click add news, it will say ERROR??


Can you please provide me with the error it is giving, as well as what you did when you installed the modification.

mapleblade
05-28-2009, 08:27 AM
at me its really weird its all on the wrong place,

take a look, and HELP ME! :(

http://yoshisisland.0fees.net/adoptables/news.php?nid=1

Bloodrun
05-28-2009, 08:30 AM
at me its really weird its all on the wrong place,

take a look, and HELP ME! :(

http://yoshisisland.0fees.net/adoptables/news.php?nid=1


Oh boy, it's really messing up your layout.
hmm, can i see your template file?

The reason I ask, is because are you using the:

$article_content

or are you using something else?

I think I may know the problem, but would you allow me access to your ftp to fix it?
I believe the structure is just conflicting with the way your template is set up.

Saphira
05-28-2009, 10:26 AM
Lol thanks =D
Let me know if something doesn't work right, or if there's something you think should be added.


postedit.php is missing. :P

Bloodrun
05-28-2009, 10:27 AM
Lol thanks =D
Let me know if something doesn't work right, or if there's something you think should be added.


postedit.php is missing. :P


DOH! >.<
Added.

Saphira
05-28-2009, 10:32 AM
Hmm, is there any way to make the system recognise new paragraphs? I've tried html and bbcode, and they both fail. Everything shows up in one continuous paragraph.

Bloodrun
05-28-2009, 10:39 AM
Hmm, is there any way to make the system recognise new paragraphs? I've tried html and bbcode, and they both fail. Everything shows up in one continuous paragraph.


Did you try <br>?

If that doesn't work, Ill just convert the thing to BBcode.

mapleblade
05-28-2009, 10:40 AM
at me its really weird its all on the wrong place,

take a look, and HELP ME! :(

http://yoshisisland.0fees.net/adoptables/news.php?nid=1


Oh boy, it's really messing up your layout.
hmm, can i see your template file?

The reason I ask, is because are you using the:

$article_content

or are you using something else?

I think I may know the problem, but would you allow me access to your ftp to fix it?
I believe the structure is just conflicting with the way your template is set up.



Well here is my template :

<html>
<head>
<TITLE>:BROWSERTITLE:</TITLE>
<meta name="keywords" content="{%MetaKeywords%}">
<meta name="description" content="{%MetaDescription%}">
<meta http-equiv="Content-Type" content="{%MetaCharset%}">
<style type="text/css">
<!--
td {
font-family: Tahoma, Arial, Helvetica, sans-serif;
font-size: 11px;
}
body {
background-image: url(images/e025_01.png);
}
.content {
padding-top: 20px;
padding-right: 20px;
padding-bottom: 40px;
padding-left: 20px;
background-image: url(images/e025_14.png);
background-repeat: no-repeat;
background-position: top;
background-color: #FFFFFF;
}
.menutop {
height: 29px;
padding-right: 10px;
padding-left: 5px;
vertical-align: middle;
font-weight: bold;
color: #FFFFFF;
background-image: url(images/e025_09.png);
background-repeat: no-repeat;
background-position: right;
}
#menu {
height:35px;
line-height:35px;
background:url(images/d018_08.jpg) repeat-x;
padding:0 10px;
}
#menu ul {
list-style-type:none;
}
#menu li {
float:left;
}
#menu li a {
padding:0 15px;
display:block;
color:#ffffff;
margin-right:2px;
}
#menu li a:hover {
background:url(images/bg-menu-hover.png) no-repeat center center;
}
a:link, a:visited {
color: #FFFFFF;
text-decoration: underline;
}
a:hover {
color: #000000;
text-decoration: none;
}
.menutop a:link, .menutop a:visited {
color: #FFFFFF;
text-decoration: none;
}
.menutop a:hover {
color: #C8FBFD;
text-decoration: underline;
}
.footer, .footer a:link, .footer a:visited {
color: #000000;
}
.newsbar {
color: #000000;
font-weight: bold;
padding-left: 40px;
}
.logo {
font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
font-weight: bold;
color: #FFFFFF;
}
.leftcontent {
padding-top: 10px;
padding-right: 10px;
padding-bottom: 25px;
padding-left: 35px;
}
.style1 {font-size: 16px}
.date {
color: #FFFFFF;
padding-right: 15px;
padding-left: 15px;
}
-->
</style>
</head>
<body bgcolor="#000000" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table width="745" height="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="211" height="69" background="images/e025_02.png">&nbsp;</td>
<td><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><img src="images/e025_03.png" width="534" height="39" alt=""></td>
</tr>
<tr>
<td height="35" background="images/e025_07.png"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
</table></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
<tr>
<td height="100%"><table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="211" valign="top" background="images/e025_22.png"><table width="211" height="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="129" align="center" background="images/e025_13.png"><table width="210" border="0" cellpadding="5" cellspacing="0">
<tr>
<td align="center" nowrap class="logo"><span class="style1">:SITENAME: </span><br>
Where Yoshi's are the Boss</td>
</tr>
</table></td>
</tr>
<tr>
<td height="58" background="images/e025_15.png" class="newsbar">Explore</td>
</tr>
<tr>
<td height="100%" valign="top" background="images/e025_17.png" class="leftcontent">:SIDEFEED:</td>
</tr>
<tr>
<td height="7" background="images/e025_17.png"><img src="images/e025_20.png" width="211" height="7" alt=""></td>
</tr>
<tr>
<td height="6"><img src="images/e025_21.png" width="211" height="6" alt=""></td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td height="124" background="images/e025_25.png">&nbsp;</td>
</tr>
</table></td>
<td valign="top"><table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
<div id="menu">
<ul>
:LINKSBAR:
</ul>
</div>
<tr>
<td height="100%" valign="top" class="content"><p>:ARTICETITLE::ARTICLEDATE:<br><br>:ARTICLECONTENT:</p>
</td>
</tr>
<tr>
<td height="65" align="center" background="images/e025_26.png">Powered by Rusnak PHP Adoptables Script</td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table>
</body>
</html>

Bloodrun
05-28-2009, 10:41 AM
at me its really weird its all on the wrong place,

take a look, and HELP ME! :(

http://yoshisisland.0fees.net/adoptables/news.php?nid=1


Oh boy, it's really messing up your layout.
hmm, can i see your template file?

The reason I ask, is because are you using the:

$article_content

or are you using something else?

I think I may know the problem, but would you allow me access to your ftp to fix it?
I believe the structure is just conflicting with the way your template is set up.



Well here is my template :

<html>
<head>
<TITLE>:BROWSERTITLE:</TITLE>
<meta name="keywords" content="{%MetaKeywords%}">
<meta name="description" content="{%MetaDescription%}">
<meta http-equiv="Content-Type" content="{%MetaCharset%}">
<style type="text/css">
<!--
td {
font-family: Tahoma, Arial, Helvetica, sans-serif;
font-size: 11px;
}
body {
background-image: url(images/e025_01.png);
}
.content {
padding-top: 20px;
padding-right: 20px;
padding-bottom: 40px;
padding-left: 20px;
background-image: url(images/e025_14.png);
background-repeat: no-repeat;
background-position: top;
background-color: #FFFFFF;
}
.menutop {
height: 29px;
padding-right: 10px;
padding-left: 5px;
vertical-align: middle;
font-weight: bold;
color: #FFFFFF;
background-image: url(images/e025_09.png);
background-repeat: no-repeat;
background-position: right;
}
#menu {
height:35px;
line-height:35px;
background:url(images/d018_08.jpg) repeat-x;
padding:0 10px;
}
#menu ul {
list-style-type:none;
}
#menu li {
float:left;
}
#menu li a {
padding:0 15px;
display:block;
color:#ffffff;
margin-right:2px;
}
#menu li a:hover {
background:url(images/bg-menu-hover.png) no-repeat center center;
}
a:link, a:visited {
color: #FFFFFF;
text-decoration: underline;
}
a:hover {
color: #000000;
text-decoration: none;
}
.menutop a:link, .menutop a:visited {
color: #FFFFFF;
text-decoration: none;
}
.menutop a:hover {
color: #C8FBFD;
text-decoration: underline;
}
.footer, .footer a:link, .footer a:visited {
color: #000000;
}
.newsbar {
color: #000000;
font-weight: bold;
padding-left: 40px;
}
.logo {
font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
font-weight: bold;
color: #FFFFFF;
}
.leftcontent {
padding-top: 10px;
padding-right: 10px;
padding-bottom: 25px;
padding-left: 35px;
}
.style1 {font-size: 16px}
.date {
color: #FFFFFF;
padding-right: 15px;
padding-left: 15px;
}
-->
</style>
</head>
<body bgcolor="#000000" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table width="745" height="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="211" height="69" background="images/e025_02.png">&nbsp;</td>
<td><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><img src="images/e025_03.png" width="534" height="39" alt=""></td>
</tr>
<tr>
<td height="35" background="images/e025_07.png"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
</table></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
<tr>
<td height="100%"><table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="211" valign="top" background="images/e025_22.png"><table width="211" height="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="129" align="center" background="images/e025_13.png"><table width="210" border="0" cellpadding="5" cellspacing="0">
<tr>
<td align="center" nowrap class="logo"><span class="style1">:SITENAME: </span><br>
Where Yoshi's are the Boss</td>
</tr>
</table></td>
</tr>
<tr>
<td height="58" background="images/e025_15.png" class="newsbar">Explore</td>
</tr>
<tr>
<td height="100%" valign="top" background="images/e025_17.png" class="leftcontent">:SIDEFEED:</td>
</tr>
<tr>
<td height="7" background="images/e025_17.png"><img src="images/e025_20.png" width="211" height="7" alt=""></td>
</tr>
<tr>
<td height="6"><img src="images/e025_21.png" width="211" height="6" alt=""></td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td height="124" background="images/e025_25.png">&nbsp;</td>
</tr>
</table></td>
<td valign="top"><table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
<div id="menu">
<ul>
:LINKSBAR:
</ul>
</div>
<tr>
<td height="100%" valign="top" class="content"><p>:ARTICETITLE::ARTICLEDATE:<br><br>:ARTICLECONTENT:</p>
</td>
</tr>
<tr>
<td height="65" align="center" background="images/e025_26.png">Powered by Rusnak PHP Adoptables Script</td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table>
</body>
</html>


Ahh two things, first off, you need to link back to Rusnak not just say it ;)

and two, only the :ARTICLECONTENT: should be in <p> tags.

mapleblade
05-28-2009, 10:47 AM
oh oops and just <p>:ARTICECONTENT:</p>?

Bloodrun
05-28-2009, 11:01 AM
oh oops and just <p>:ARTICECONTENT:</p>?


Yessir! =D

mapleblade
05-28-2009, 12:22 PM
now its still bugged :( (but its better then earlier)

Saphira
05-28-2009, 01:45 PM
Hmm, is there any way to make the system recognise new paragraphs? I've tried html and bbcode, and they both fail. Everything shows up in one continuous paragraph.


Did you try <br>?

If that doesn't work, Ill just convert the thing to BBcode.


I tried <br>, and <p>, and neither work. It turns

These

Are

Separate, into

These are separate, etc.

Bloodrun
05-28-2009, 02:11 PM
now its still bugged :( (but its better then earlier)


That is strange =/




Hmm, is there any way to make the system recognise new paragraphs? I've tried html and bbcode, and they both fail. Everything shows up in one continuous paragraph.


Did you try <br>?

If that doesn't work, Ill just convert the thing to BBcode.


I tried <br>, and <p>, and neither work. It turns

These

Are

Separate, into

These are separate, etc.


Alright, then ill have to make BBcode work for it.

Saphira
05-30-2009, 03:10 PM
Hmm. I haven't tried this out since I changed the database field for detail to LONGTEXT. I'm trying to post news now, and I'm getting an error on add_news.php. I'm guessing that there's an error inserting it into the database.

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

The line of code to insert it, and below, the database layout:


nid int(11)
topic varchar(255)
detail longtext
name varchar(65)
datetime varchar(25)


Does this all seem right to you?

Bloodrun
05-30-2009, 08:31 PM
Hmm. I haven't tried this out since I changed the database field for detail to LONGTEXT. I'm trying to post news now, and I'm getting an error on add_news.php. I'm guessing that there's an error inserting it into the database.

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

The line of code to insert it, and below, the database layout:


nid int(11)
topic varchar(255)
detail longtext
name varchar(65)
datetime varchar(25)


Does this all seem right to you?


Can you tell me the error please.

And find the '$result' nearest to the line where it says the error is, and place this right after it:

die('Invalid query: ' . mysql_error());

Saphira
05-31-2009, 04:36 AM
Invalid query: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'm testing this using single quotes.', 'Jon', '31/05/09 02:32:12')' at line 1

I tried to post:

I'm testing this using single quotes.

Someone else posted last night after I went to bed, and they managed to post fine, so I'm guessing it has something to do with single quotes. (')

Bloodrun
05-31-2009, 04:46 AM
Invalid query: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'm testing this using single quotes.', 'Jon', '31/05/09 02:32:12')' at line 1

I tried to post:

I'm testing this using single quotes.

Someone else posted last night after I went to bed, and they managed to post fine, so I'm guessing it has something to do with single quotes. (')


That's really wierd because it works fine on my test site, and some one else site.

I believe I put stripspalshes in the code, make sure i stripsplashed the name of the poster, the title and the details.

Saphira
05-31-2009, 06:07 AM
What part of the code are the stripslash parts in? I can double check just to make sure that they're there etc.

Bloodrun
05-31-2009, 03:36 PM
What part of the code are the stripslash parts in? I can double check just to make sure that they're there etc.


They would be right after a query and the items it is calling.

It would look like this:

$something = stripsplash($something)

Saphira
05-31-2009, 09:56 PM
Okay, I've looked through the files, and the only file I can find the stripslashes in is news.php. Wouldn't it need to be in add_news.php, being's that's the file that adds news to the database (which the script is having trouble doing?) I downloaded a fresh copy of the zip file, and it's the same in there. Only on news.php

Bloodrun
05-31-2009, 10:05 PM
Okay, I've looked through the files, and the only file I can find the stripslashes in is news.php. Wouldn't it need to be in add_news.php, being's that's the file that adds news to the database (which the script is having trouble doing?) I downloaded a fresh copy of the zip file, and it's the same in there. Only on news.php


Oh, well I usually only put the stripsplash in the file that is calling the info, but I should probably do start doing it the other way.

Anyway, um, what was your problem again? Lol I cant remember.

EDIT:

This is really wierd, because the sites I installed this on, don't have that error at all, and they have tons of single quotes in their posts o.0

Saphira
06-01-2009, 08:18 AM
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.

Bloodrun
06-01-2009, 08:31 AM
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
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
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
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
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
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
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
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
I used

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

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

I've been trying to add somewhere:

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:

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
If you just want to have only admins and news editors edit the page, do this:

if($isloggedin == "yes"){

$mygroup = getgroup();

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

// Do your stuff here

}

}

In this line:

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
I had to change that a lil' bit, but I got it to work. :D

Finished 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
I had to change that a lil' bit, but I got it to work. :D

Finished 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
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
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
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.

Saphira
06-02-2009, 08:13 AM
IDIDITIDIDITIDIDIT!


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


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


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
What did you do?


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

in add_reply.php

Bloodrun
06-02-2009, 05:52 PM
What did you do?


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

in add_reply.php


Ahh very well.

Saphira
06-04-2009, 04:08 PM
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
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
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
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
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
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
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
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...


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


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