Opening Not Sloved Submit News Not Posting to Site

  Post new topicReply to topicPrintable Version
<< View previous topic View next topic >>
Share: Del.icio.us  Digg  Google  Spurl  Blink  Furl  Y! MyWeb  
#1   Opening Not Sloved Submit News Not Posting to Site
Ghost_Hunter
CZ Super Newbie
 Codezwiz Site Donator
Ghost_Hunter has been a member for over 19 year's 19 Year Member
usa.gif georgia.gif
Occupation: Writer, paranormal Investigator
Gender: Female
Website:
Status: Offline
Joined: Feb 17, 2005
0.01 posts per day
Posts: 83
Points: 2,651
   
Could someone please explain how I go about bypassing article approval? Instead of the admin having to approve each article, I would like for it to post automaticly.

Oh, and let me say, as a newbie to PHP, I've searched through many PHP-Nuke Forums looking for help on various subjects, and Codewiz by far exceeds them all when it comes to helping and being friendly about it. I've seen some very rude responces when it comes to a newbie asking for help. So a big PAT on the back!

Before I forget, I use Nuke 7.5

Any help greatly appreciated.

*Updated* I thought I had found the fix (located here in the forums) but after I did it, the news didn't show up at all, but I would get a mail telling me I had news on my site which showed what I had posted, but yet, it's not on the site anywhere, and it's not waiting to be approved. I put everything back the way it was before, but still, the posted news is not showing. I hope someone can help me figure this all out.
Thanks



Back to top Reply with quote
#2   
fncool
CZ Super Newbie
 Codezwiz Site Donator
fncool has been a member for over 19 year's 19 Year Member
canada.gif
Age: 62
Gender: Male
Status: Offline
Joined: Dec 19, 2004
0.01 posts per day
Posts: 56
Points: 4,786
   
you tried this?
[ Register or login to view links on this board. ]

i know there is an addon to do this for news, i'm just not sure which one does articles.




_________________
I'm only replying because I want those extra 22.52 points!
Back to top Reply with quote
#3   re: How do I bypass article approval?
Ghost_Hunter
CZ Super Newbie
 Codezwiz Site Donator
Ghost_Hunter has been a member for over 19 year's 19 Year Member
usa.gif georgia.gif
Occupation: Writer, paranormal Investigator
Gender: Female
Website:
Status: Offline
Joined: Feb 17, 2005
0.01 posts per day
Posts: 83
Points: 2,651
   
Hi, thanks for answering. Yes, I did try that, and now everything is messed up, even after I changed it back to the orginal. Now, when you post, I recieve mail saying you have news on your site and it shows in the mail what was posted, but it's not showing up on the site itself and it's nowhere to be found. Does anyone have copies of the submit news.php that I can have so I can replace it? I'll post mine here, maybe someone will see if I have a mistake.
Thanks
<?php

/************************************************************************/
/* PHP-NUKE: Web Portal System                                          */
/* ===========================                                          */
/*                                                                      */
/* Copyright (c) 2002 by Francisco Burzi                                */
/* http://phpnuke.org                                                   */
/*                                                                      */
/* This program is free software. You can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 2 of the License.       */
/*                                                                      */
/************************************************************************/
/*         Additional security & Abstraction layer conversion           */
/*                           2003 chatserv                              */
/*      http://www.nukefixes.com -- http://www.nukeresources.com        */
/************************************************************************/

if (!eregi("modules.php", $_SERVER['PHP_SELF'])) {
    die ("You can't access this file directly...");
}
require_once("mainfile.php");
$module_name = basename(dirname(__FILE__));
get_lang($module_name);
$pagetitle = "- "._SUBMITNEWS."";

function defaultDisplay() {
    global $AllowableHTML, $prefix, $user, $cookie, $anonymous, $currentlang, $multilingual, $db, $module_name;
    include ('header.php');
    OpenTable();
    echo "<center><font class=\"title\"><b>"._SUBMITNEWS."</b></font><br><br>";
    echo "<font class=\"content\"><i>"._SUBMITADVICE."</i></font></center><br>";
    CloseTable();
    echo "<br>";
    OpenTable();
    if (is_user($user)) getusrinfo($user);
    echo "<p><form action=\"modules.php?name=$module_name\" method=\"post\">"
   ."<b>"._YOURNAME.":</b> ";
    if (is_user($user)) {
   cookiedecode($user);
   echo "<a href=\"account.html\">$cookie[1]</a> <font class=\"content\">[ <a href=\"account.html&amp;op=logout\">"._LOGOUT."</a> ]</font>";
    } else {
       echo "$anonymous <font class=\"content\">[ <a href=\"account.html\">"._NEWUSER."</a> ]</font>";
    }
    echo "<br><br>"
        ."<b>"._SUBTITLE."</b> "
        ."("._BEDESCRIPTIVE.")<br>"
        ."<input type=\"text\" name=\"subject\" size=\"50\" maxlength=\"80\"><br><font class=\"content\">("._BADTITLES.")</font>"
        ."<br><br>"
        ."<b>"._TOPIC.":</b> <select name=\"topic\">";
    $result = $db->sql_query("SELECT topicid, topictext FROM ".$prefix."_topics ORDER BY topictext");
    echo "<option value=\"\">"._SELECTTOPIC."</option>\n";
    while ($row = $db->sql_fetchrow($result)) {
   $topicid = intval($row['topicid']);
   $topics = stripslashes(check_html($row['topictext'], "nohtml"));
        if ($topicid == $topic) {
       $sel = "selected ";
   }
       echo "<option $sel value=\"$topicid\">$topics</option>\n";
   $sel = "";
    }
    echo "</select>";
    if ($multilingual == 1) {
   echo "<br><br><b>"._LANGUAGE.": </b>"
       ."<select name=\"alanguage\">";
   $handle=opendir('language');
   while ($file = readdir($handle)) {
       if (preg_match("/^lang\-(.+)\.php/", $file, $matches)) {
           $langFound = $matches[1];
           $languageslist .= "$langFound ";
       }
   }
   closedir($handle);
   $languageslist = explode(" ", $languageslist);
   sort($languageslist);
   for ($i=0; $i < sizeof($languageslist); $i++) {
       if($languageslist[$i]!="") {
      echo "<option value=\"$languageslist[$i]\" ";
       if($languageslist[$i]==$currentlang) echo "selected";
      echo ">".ucfirst($languageslist[$i])."</option>\n";
       }
   }
   echo "</select>";
    } else {
   echo "<input type=\"hidden\" name=\"alanguage\" value=\"$language\">";
    }
   echo "<br><br>"
        ."<b>"._STORYTEXT.":</b> ("._HTMLISFINE.")<br>"
   ."<textarea cols=\"50\" rows=\"12\" name=\"story\"></textarea><br>"
        ."<br><br><b>"._EXTENDEDTEXT.":</b><br>"
   ."<textarea cols=\"50\" rows=\"12\" name=\"storyext\"></textarea><br>"
   ."("._AREYOUSURE.")</font><br><br>"
        ."<font class=\"content\">"._ALLOWEDHTML."<br>";
    while (list($key,) = each($AllowableHTML)) echo " &lt;".$key."&gt;";
    echo "<br><br><input type=\"submit\" name=\"op\" value=\""._PREVIEW."\"> ;; ;;"
   ."<select name=\"posttype\">\n"
   ."<option value=\"exttrans\">"._EXTRANS."</option>\n"
   ."<option value=\"html\" >"._HTMLFORMATED."</option>\n"
   ."<option value=\"plaintext\" selected>"._PLAINTEXT."</option>\n"
   ."</select>"
   ."<br>("._SUBPREVIEW.")</form>";
    CloseTable();
    include ('footer.php');
}

function PreviewStory($name, $address, $subject, $story, $storyext, $topic, $alanguage, $posttype) {
    global $user, $cookie, $bgcolor1, $bgcolor2, $anonymous, $prefix, $multilingual, $AllowableHTML, $db, $module_name;
    include ('header.php');
    $subject = stripslashes(check_html($subject, "nohtml"));
    $story = stripslashes($story);
    $storyext = stripslashes($storyext);
    if ($posttype=="exttrans") {
        $f_story = nl2br(htmlspecialchars($story));
   $f_storyext = nl2br(htmlspecialchars($storyext));
    } elseif ($posttype=="plaintext") {
        $f_story = nl2br($story);
   $f_storyext = nl2br($storyext);
    } else {
   $f_story = $story;
   $f_storyext = $storyext;
    }
    $story2 = "$f_story<br><br>$f_storyext";
    OpenTable();
    echo "<center><font class=\"title\"><b>"._NEWSUBPREVIEW."</b></font>";
    CloseTable();
    echo "<br>";
    OpenTable();
    echo "<center><i>"._STORYLOOK."</i></center><br><br>";
    echo "<table width=\"70%\" bgcolor=\"$bgcolor2\" cellpadding=\"0\" cellspacing=\"1\" border=\"0\"align=\"center\"><tr><td>"
   ."<table width=\"100%\" bgcolor=\"$bgcolor1\" cellpadding=\"8\" cellspacing=\"1\" border=\"0\"><tr><td>";
    if ($topic=="") {
        $topicimage="AllTopics.gif";
        $warning = "<center><blink><b>"._SELECTTOPIC."</b></blink></center>";
    } else {
        $warning = "";
        $row = $db->sql_fetchrow($db->sql_query("SELECT topicimage FROM ".$prefix."_topics WHERE topicid='$topic'"));
   $topicimage = stripslashes($row['topicimage']);
    }
    echo "<img src=\"images/topics/$topicimage\" border=\"0\" align=\"right\">";
    themepreview($subject, $story2);
    echo "$warning"
   ."</td></tr></table></td></tr></table>"
   ."<br><br><center><font class=\"tiny\">"._CHECKSTORY."</font></center>";
    CloseTable();
    echo "<br>";
    OpenTable();
    echo "<p><form action=\"modules.php?name=$module_name\" method=\"post\">"
   ."<b>"._YOURNAME.":</b> ";
    if (is_user($user)) {
       cookiedecode($user);
   echo "<a href=\"account.html\">$cookie[1]</a> <font class=\"content\">[ <a href=\"account.html&amp;op=logout\">"._LOGOUT."</a> ]</font>";
    } else {
   echo "$anonymous";
    }
    echo "<br><br><b>"._SUBTITLE.":</b><br>"
   ."<input type=\"text\" name=\"subject\" size=\"50\" maxlength=\"80\" value=\"$subject\">"
   ."<br><br><b>"._TOPIC.": </b><select name=\"topic\">";
    $result2 = $db->sql_query("SELECT topicid, topictext FROM ".$prefix."_topics ORDER BY topictext");
    echo "<OPTION VALUE=\"\">"._SELECTTOPIC."</option>\n";
    while ($row2 = $db->sql_fetchrow($result2)) {
   $topicid = intval($row2['topicid']);
   $topics = stripslashes(check_html($row2['topictext'], "nohtml"));
        if ($topicid == $topic) {
       $sel = "selected ";
   }
   echo "<option $sel value=\"$topicid\">$topics</option>\n";
   $sel = "";
    }
    echo "</select>";
    if ($multilingual == 1) {
   echo "<br><br><b>"._LANGUAGE.": </b>"
       ."<select name=\"alanguage\">";
   $handle=opendir('language');
   while ($file = readdir($handle)) {
       if (preg_match("/^lang\-(.+)\.php/", $file, $matches)) {
           $langFound = $matches[1];
           $languageslist .= "$langFound ";
       }
   }
   closedir($handle);
   $languageslist = explode(" ", $languageslist);
   sort($languageslist);
   for ($i=0; $i < sizeof($languageslist); $i++) {
       if($languageslist[$i]!="") {
      echo "<option value=\"$languageslist[$i]\" ";
      if($languageslist[$i]==$alanguage) echo "selected";
      echo ">".ucfirst($languageslist[$i])."</option>\n";
       }
   }
   echo "</select>";
    }
    echo "<br><br><b>"._STORYTEXT.":</b> ("._HTMLISFINE.")<br>"
        ."<textarea cols=\"50\" rows=\"12\" name=\"story\">$story</textarea><br>"
   ."<br><b>"._EXTENDEDTEXT.":</b><br>"
   ."<textarea cols=\"50\" rows=\"12\" name=\"storyext\">$storyext</textarea><br>"
   ."<font class=\"content\">("._AREYOUSURE.")</font><br><br>"
   .""._ALLOWEDHTML."<br>";
    while (list($key,) = each($AllowableHTML)) echo " &lt;".$key."&gt;";
    echo "<br><br>"
        ."<input type=\"submit\" name=\"op\" value=\""._PREVIEW."\"> ;; ;;"
   ."<input type=\"submit\" name=\"op\" value=\""._OK."\"> ;; ;;"
   ."<select name=\"posttype\"><option value=\"exttrans\"";
    if ($posttype=="exttrans") {
        echo " selected";
    }
    echo ">"._EXTRANS."</option>\n"
   ."<OPTION value=\"html\"";;
    if ($posttype=="html") {
        echo " selected";
    }
    echo ">"._HTMLFORMATED."</option>\n"
   ."<OPTION value=\"plaintext\"";
    if (($posttype!="exttrans") && ($posttype!="html")) {
        echo " selected";
    }
    echo ">"._PLAINTEXT."</option></select>"
   ."</form>";
    CloseTable();
    include ('footer.php');
}

function submitStory($name, $address, $subject, $story, $storyext, $topic, $alanguage, $posttype) {
    global $user, $EditedMessage, $cookie, $anonymous, $notify, $notify_email, $notify_subject, $notify_message, $notify_from, $prefix, $db;
    if (is_user($user)) {
       cookiedecode($user);
   $uid = $cookie[0];
   $name = $cookie[1];
    } else {
       $uid = 1;
   $name = "$anonymous";
    }
    $subject = ereg_replace("\"", "''", $subject);
    $subject = FixQuotes(filter_text($subject, "nohtml"));
    if($posttype=="exttrans") {
       $story = FixQuotes(nl2br(htmlspecialchars(check_words($story))));
   $storyext = FixQuotes(nl2br(htmlspecialchars(check_words($storyext))));
    } elseif($posttype=="plaintext") {
       $story = FixQuotes(nl2br(filter_text($story)));
   $storyext = FixQuotes(nl2br(filter_text($storyext)));
    } else {
   $story = FixQuotes(filter_text($story));
   $storyext = FixQuotes(filter_text($storyext));
    }
    $result = $db->$sql = "INSERT INTO ".$prefix."_queue VALUES (NULL, '$uid', '$name', '$subject',
'$story', '$storyext', now(), '$topic', '$alanguage')";
    if(!$result) {
       echo ""._ERROR."<br>";
   exit();
    }
    if($notify) {
   $notify_message = "$notify_message\n\n\n========================================================\n$subject\n\n\n$story\n\n$storyext\n\n$name";
       mail($notify_email, $notify_subject, $notify_message, "From: $notify_from\nX-Mailer: PHP/" . phpversion());
    }
    include ('header.php');
    OpenTable();
    $waiting = $db->sql_numrows($db->sql_query("SELECT * FROM ".$prefix."_queue"));
    echo "<center><font class=\"title\">"._SUBSENT."</font><br><br>"
   ."<font class=\"content\"><b>"._THANKSSUB."</b><br><br>"
   .""._SUBTEXT.""
   ."<br>"._WEHAVESUB." $waiting "._WAITING."";
    CloseTable();
    include ('footer.php');
}

switch($op) {

    case ""._PREVIEW."":
   PreviewStory($name, $address, $subject, $story, $storyext, $topic, $alanguage, $posttype);
   break;

    case ""._OK."":
   SubmitStory($name, $address, $subject, $story, $storyext, $topic, $alanguage, $posttype);
   break;

    default:
   defaultDisplay();
   break;

}

?>




Back to top Reply with quote
#4   re: How do I bypass article approval?
echo
CZ Wiz
 Codezwiz Site Donator
echo has been a member for over 20 year's 20 Year Member
Gender: Male
Status: Offline
Joined: Oct 04, 2003
0.15 posts per day
Posts: 1147
Points: 93
   
Here's a default index.php from Nuke 7.5.



Back to top Reply with quote
#5   re: How do I bypass article approval?
Ghost_Hunter
CZ Super Newbie
 Codezwiz Site Donator
Ghost_Hunter has been a member for over 19 year's 19 Year Member
usa.gif georgia.gif
Occupation: Writer, paranormal Investigator
Gender: Female
Website:
Status: Offline
Joined: Feb 17, 2005
0.01 posts per day
Posts: 83
Points: 2,651
   
Thanks Echo. I appreciate the help. For the life of me, I can't see the difference between the two examples you showed. I've download the full one you provided and will give it a shot.

You guys are great! thanks for all the help.



Back to top Reply with quote
#6   re: How do I bypass article approval?
Ghost_Hunter
CZ Super Newbie
 Codezwiz Site Donator
Ghost_Hunter has been a member for over 19 year's 19 Year Member
usa.gif georgia.gif
Occupation: Writer, paranormal Investigator
Gender: Female
Website:
Status: Offline
Joined: Feb 17, 2005
0.01 posts per day
Posts: 83
Points: 2,651
   
Well, I replaced the the old index with the new one you gave me, and it still didn't work. It's not posting to the site, and it's not waiting to be approved. I don't know what's wrong. I hope someone can help me figure this out. the site is [ Register or login to view links on this board.] if you need to take a look. I really appreciate y'all trying to help.

I might have found the problem, but not sure. Is this the correct code for the mainfile.php for 7.5? I think I might have used a wrong thread when doing the bypass article, and used one for an older nuke.

  function formatAidHeader($aid) {
    global $prefix, $db;
    $result = $db->sql_query("SELECT url, email FROM ".$prefix."_authors WHERE aid='$aid'");
    $row = $db->sql_fetchrow($result);
    $url = $row['url'];
    $email = stripslashes($row['email']);
    if (isset($url)) {
        $aid = "<a href=\"$url\">$aid</a>";
    } elseif (isset($email)) {
   $aid = "<a href=\"mailto:$email\">$aid</a>";
    } else {
   $aid = $aid;
    }
    echo "$aid";
}


Anyone?


Back to top Reply with quote
#7   re: How do I bypass article approval?
Ghost_Hunter
CZ Super Newbie
 Codezwiz Site Donator
Ghost_Hunter has been a member for over 19 year's 19 Year Member
usa.gif georgia.gif
Occupation: Writer, paranormal Investigator
Gender: Female
Website:
Status: Offline
Joined: Feb 17, 2005
0.01 posts per day
Posts: 83
Points: 2,651
   
Can anyone help with this problem? It seems to be my only major problem left, and it's a big one for a site that relies on articles/news and such.



Back to top Reply with quote
#8   re: How do I bypass article approval?
echo
CZ Wiz
 Codezwiz Site Donator
echo has been a member for over 20 year's 20 Year Member
Gender: Male
Status: Offline
Joined: Oct 04, 2003
0.15 posts per day
Posts: 1147
Points: 93
   
Ghost...Not sure what to make out of all this. I really don't understand what you've tried, and how many times those files have been edited. One thing you have to carve in stone here: Backup. When editing, moding, altering, whatever...backup first! record your steps, it is so much easier to follow through that way. Just a FYI for the future. icon_wink.gif



Back to top Reply with quote
#9   re: How do I bypass article approval?
Ghost_Hunter
CZ Super Newbie
 Codezwiz Site Donator
Ghost_Hunter has been a member for over 19 year's 19 Year Member
usa.gif georgia.gif
Occupation: Writer, paranormal Investigator
Gender: Female
Website:
Status: Offline
Joined: Feb 17, 2005
0.01 posts per day
Posts: 83
Points: 2,651
   
Ok, here's how the whole mess happened. I had been reading the Nuke-How To on NukeCops, learning how to do differnt things. Here's the page for what I apptempted to do that caused the problem. [ Register or login to view links on this board. ] and the other link that is on the page. Oh, and trust me, Echo, I backup everything now.

hope that makes sense.



Back to top Reply with quote
#10   [SOLVED !! ] YES! re: How do I bypass article approval?
Ghost_Hunter
CZ Super Newbie
 Codezwiz Site Donator
Ghost_Hunter has been a member for over 19 year's 19 Year Member
usa.gif georgia.gif
Occupation: Writer, paranormal Investigator
Gender: Female
Website:
Status: Offline
Joined: Feb 17, 2005
0.01 posts per day
Posts: 83
Points: 2,651
   
Echo and Telli, I know you'll be relieved to know I sloved my problem! icon_wink.gif Now maybe I can give you folks some peace & quiet. I was pouring through each file I might have messed with when attempting to try that fix for automatic story submission and I noticed that in the root/submit news / there were two files named index. One was index.php, the other was index php.txt. I'm assuming when I uploaded the index I had saved, I hadn't saved it as php. Anyways, I removed the odd one, and bingo! All fixed now.
Thanks for putting up with me!



Back to top Reply with quote
Display posts from previous:      
Add To: Del.icio.us  Digg  Google  Spurl  Blink  Furl  Y! MyWeb  
<< View previous topic View next topic >>
Post new topicReply to topic

Jump to 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum