Mysidia Adoptables Support Forum  

Home Community Mys-Script Creative Off-Topic
Go Back   Mysidia Adoptables Support Forum > Mysidia Adoptables > Addons and Modifications > Addons/Mods Graveyard

Notices

Reply
 
Thread Tools Display Modes
  #51  
Old 06-01-2009, 06:29 PM
Saphira Saphira is offline
Member
 
Join Date: Jan 2009
Posts: 89
Credits: 5,752
Saphira
Default 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
Reply With Quote
  #52  
Old 06-01-2009, 06:37 PM
BMR777 BMR777 is offline
Member
 
Join Date: Jan 2011
Posts: 1,122
Gender: Male
Credits: 10,697
BMR777 is on a distinguished road
Default 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. :)
Reply With Quote
  #53  
Old 06-01-2009, 07:14 PM
Saphira Saphira is offline
Member
 
Join Date: Jan 2009
Posts: 89
Credits: 5,752
Saphira
Default 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)
Reply With Quote
  #54  
Old 06-01-2009, 07:16 PM
Bloodrun's Avatar
Bloodrun Bloodrun is offline
I am, who I am.
 
Join Date: Apr 2009
Posts: 532
Gender: Male
Credits: 28,582
Bloodrun
Send a message via Yahoo to Bloodrun
Default 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
Reply With Quote
  #55  
Old 06-01-2009, 07:55 PM
Saphira Saphira is offline
Member
 
Join Date: Jan 2009
Posts: 89
Credits: 5,752
Saphira
Default RE: Adopts News

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

The triforce power shall help me! ▲
Reply With Quote
  #56  
Old 06-01-2009, 07:58 PM
Bloodrun's Avatar
Bloodrun Bloodrun is offline
I am, who I am.
 
Join Date: Apr 2009
Posts: 532
Gender: Male
Credits: 28,582
Bloodrun
Send a message via Yahoo to Bloodrun
Default 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 >.<
Reply With Quote
  #57  
Old 06-01-2009, 08:02 PM
Saphira Saphira is offline
Member
 
Join Date: Jan 2009
Posts: 89
Credits: 5,752
Saphira
Default 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.
Reply With Quote
  #58  
Old 06-02-2009, 08:13 AM
Saphira Saphira is offline
Member
 
Join Date: Jan 2009
Posts: 89
Credits: 5,752
Saphira
Default 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!
Reply With Quote
  #59  
Old 06-02-2009, 11:11 AM
trollis76 trollis76 is offline
Member
 
Join Date: Feb 2009
Posts: 160
Credits: 13,470
trollis76
Default 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.
Reply With Quote
  #60  
Old 06-02-2009, 11:29 AM
Saphira Saphira is offline
Member
 
Join Date: Jan 2009
Posts: 89
Credits: 5,752
Saphira
Default 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
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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Mys v1.3.4 News System IntoRain Mys v1.3.x Mods 66 02-27-2018 05:35 PM
Female Adopts can breed; male adopts only have 1. Phoeniix Questions and Supports 2 11-09-2013 01:56 AM
News Feed Yuki Night Suggestions and Feature Requests 0 01-30-2013 12:04 AM
Implementing A News Feed Yuki Night Questions and Supports 0 01-29-2013 05:25 PM
News 12345 Questions and Supports 9 05-10-2009 03:13 PM


All times are GMT -5. The time now is 01:33 AM.

Currently Active Users: 4814 (0 members and 4814 guests)
Threads: 4,080, Posts: 32,024, 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 - 2024, vBulletin Solutions Inc.
vBCommerce I v2.0.0 Gold ©2010, PixelFX Studios
vBCredits I v2.0.0 Gold ©2010, PixelFX Studios
Emoticons by darkmoon3636