Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Blocks
Author Message
chaoscreator
New Member
New Member


Joined: Mar 15, 2008
Posts: 14

PostPosted: Thu Mar 27, 2008 11:17 pm Reply with quote

I added treemenu to the blocks directory, editing as required for the navigation of my site, but it doesn't show up in the Block Administration page. Did I install incorrectly, or is there something else I need to do?


Also, is there a way, when posting a new News article, to define the categories able to be posted in depending upon the News Article/Section the user is viewing?
 
View user's profile Send private message
montego
Site Admin


Joined: Aug 29, 2004
Posts: 9449
Location: Arizona

PostPosted: Fri Mar 28, 2008 7:51 am Reply with quote

It may have been better to ask your second question in a separate thread, but the answer is "no". That is not core *nuke functionality.

Regarding your first question, I have never used this, so am not familiar with the install. Please post a link to where we can get the the download for this block.

Thanks.

_________________
Only registered users can see links on this board! Get registered or login!
Only registered users can see links on this board! Get registered or login! 
View user's profile Send private message Visit poster's website
chaoscreator
PostPosted: Fri Mar 28, 2008 7:41 pm Reply with quote

Okay. I didn't know if there was a place I might be able to edit the PHP to be able to limit the category sections depending on the section being viewed. Would you have a suggestion as to a module that might be capable of doing something like this? I really need to have sub-categories at least three levels deep. Hmmm... Just by re-reading that it looks like I'm going to have to try to design my own module. This is gonna suck...

Anyway, as for the Treemenu issue, I found it on this website: Only registered users can see links on this board! Get registered or login!
Download link: Only registered users can see links on this board! Get registered or login!

The install instructions say to expand the files in the blocks subdirectory and then activate the block in the admin panel. But when I look in the block admin section, it's not even listed. I've made my own blocks before and simply added it to the blocks subdirectory, and it showed up with no problem.
 
chaoscreator
PostPosted: Fri Mar 28, 2008 9:13 pm Reply with quote

Yay! I got my block problem solved. I'm not even sure what the issue was, but I uploaded everything again and it works fine now.

Now to see if I can do something about subcategories.
 
montego
PostPosted: Sat Mar 29, 2008 7:13 am Reply with quote

chaoscreator, glad you got it sorted!
 
chaoscreator
PostPosted: Sat Mar 29, 2008 6:50 pm Reply with quote

Thanks.

Do you know of any module that uses subcategories, other than the Downloads and Weblinks modules?
 
chaoscreator
PostPosted: Sat Mar 29, 2008 8:01 pm Reply with quote

Could I possibly edit this bit of code from the index.php file in the Submit_News module:
Code:


    echo '<b>'._TOPIC.':</b> <select name="topic">';
    $result = $db->sql_query('SELECT topicid, topictext FROM '.$prefix.'_topics ORDER BY topictext');
    echo '<option value="" selected="selected">'._SELECTTOPIC.'</option>';
    while ($row = $db->sql_fetchrow($result)) {
        $topicid = intval($row['topicid']);
        $topics = stripslashes(check_html($row['topictext'], 'nohtml'));
        echo '<option value="'.$topicid.'">'.$topics.'</option>';
    }
    echo '</select></p><p>';


But how would you tell it to present certain categories depending upon the page you came from? Some sort of POST value could be passed, correct?

Could you use something like:
Code:
echo '<b>'._TOPIC.':</b> <select name="topic">';

if ($topic == games|gamereviews|newreleases) {
   $result = $db->sql_query('SELECT topicid, topictext FROM '.$prefix.'_topics WHERE topicid = games, gamereviews, newreleases ORDER BY topictext');
    echo '<option value="" selected="selected">'._SELECTTOPIC.'</option>';
    while ($row = $db->sql_fetchrow($result)) {
        $topicid = intval($row['topicid']);
        $topics = stripslashes(check_html($row['topictext'], 'nohtml'));
        echo '<option value="'.$topicid.'">'.$topics.'</option>';
    }
    echo '</select></p><p>';

But even that would still leave the problem of passing the value $topic, which contains the topicid of the last viewed page, to the Submit_News index.php...
 
chaoscreator
PostPosted: Sat Mar 29, 2008 8:37 pm Reply with quote

Okay, after reviewing things a bit, I see that I need to add a bit of code to the News index.php file to capture the currently viewed topic sid and pass that value via POST to the Submit_News script. Any suggestions as how to do this?

*EDIT* - Wait. Would I want to pass the variable $sid, $s_sid or $catid?
 
chaoscreator
PostPosted: Sat Mar 29, 2008 10:17 pm Reply with quote

Well, I tried replacing the code I sited above with this quickly cobbled together and rather clumsy bit of code:

Code:
        .'<b>'._TOPIC.':</b> <select name="topic">';

    if ($category == games|gamereviews|newreleases) {
    $result = $db->sql_query('SELECT topicid, topictext FROM '.$prefix.'_topics WHERE topicname="games|gamereviews|newreleases" ORDER BY topictext');
    echo '<option value="" selected="selected">'._SELECTTOPIC.'</option>';
    while ($row = $db->sql_fetchrow($result)) {
        $topicid = intval($row['topicid']);
        $topics = stripslashes(check_html($row['topictext'], 'nohtml'));
        echo '<option value="'.$topicid.'">'.$topics.'</option>';
          }
    if ($category == rituals|zodiac|stones|herbs|histpeople|histplaces|celticmyth|divination) {
    $result = $db->sql_query('SELECT topicid, topictext FROM '.$prefix.'_topics WHERE topicname="rituals|zodiac|stones|herbs|histpeople|histplaces|celticmyth|divination" ORDER BY topictext');
    echo '<option value="" selected="selected">'._SELECTTOPIC.'</option>';
    while ($row = $db->sql_fetchrow($result)) {
        $topicid = intval($row['topicid']);
        $topics = stripslashes(check_html($row['topictext'], 'nohtml'));
        echo '<option value="'.$topicid.'">'.$topics.'</option>';
          }
   if ($category == paraarticles|experiences|hauntedplaces|paragallery|evp) {
    $result = $db->sql_query('SELECT topicid, topictext FROM '.$prefix.'_topics WHERE topicname="paraarticles|experiences|hauntedplaces|paragallery|evp" ORDER BY topictext');
    echo '<option value="" selected="selected">'._SELECTTOPIC.'</option>';
    while ($row = $db->sql_fetchrow($result)) {
        $topicid = intval($row['topicid']);
        $topics = stripslashes(check_html($row['topictext'], 'nohtml'));
        echo '<option value="'.$topicid.'">'.$topics.'</option>';
          }
    if ($category == wickedarticles|wickedstories|wickedgallery|toyreviews|meetings) {
    $result = $db->sql_query('SELECT topicid, topictext FROM '.$prefix.'_topics WHERE topicname="wickedarticles|wickedstories|wickedgallery|toyreviews|meetings" ORDER BY topictext');
    echo '<option value="" selected="selected">'._SELECTTOPIC.'</option>';
    while ($row = $db->sql_fetchrow($result)) {
        $topicid = intval($row['topicid']);
        $topics = stripslashes(check_html($row['topictext'], 'nohtml'));
        echo '<option value="'.$topicid.'">'.$topics.'</option>';
          }
    if ($category == poems|stories) {
    $result = $db->sql_query('SELECT topicid, topictext FROM '.$prefix.'_topics WHERE topicname="poems|stories" ORDER BY topictext');
    echo '<option value="" selected="selected">'._SELECTTOPIC.'</option>';
    while ($row = $db->sql_fetchrow($result)) {
        $topicid = intval($row['topicid']);
        $topics = stripslashes(check_html($row['topictext'], 'nohtml'));
        echo '<option value="'.$topicid.'">'.$topics.'</option>';
          }
   if ($category == hardware|software|programming|images) {
    $result = $db->sql_query('SELECT topicid, topictext FROM '.$prefix.'_topics WHERE topicname="hardware|software|programming|images" ORDER BY topictext');
    echo '<option value="" selected="selected">'._SELECTTOPIC.'</option>';
    while ($row = $db->sql_fetchrow($result)) {
        $topicid = intval($row['topicid']);
        $topics = stripslashes(check_html($row['topictext'], 'nohtml'));
        echo '<option value="'.$topicid.'">'.$topics.'</option>';
          }
   if ($category == events|musicnews|musicreviews) {
    $result = $db->sql_query('SELECT topicid, topictext FROM '.$prefix.'_topics WHERE topicname="events|musicnews|musicreviews" ORDER BY topictext');
    echo '<option value="" selected="selected">'._SELECTTOPIC.'</option>';
    while ($row = $db->sql_fetchrow($result)) {
        $topicid = intval($row['topicid']);
        $topics = stripslashes(check_html($row['topictext'], 'nohtml'));
        echo '<option value="'.$topicid.'">'.$topics.'</option>';
          }
   }
    echo '</select></p><p>';


I'm using this link
Code:
<a href=\"modules.php?name=Submit_News&amp;category=".$topicname."\">"._SUBART."</a>

to pass which topic is being viewed.


I get a blank page. Where did I go wrong?
 
chaoscreator
PostPosted: Tue Apr 01, 2008 7:58 pm Reply with quote

Okay, I've cleaned it up a little. Here's the whole function I'm working on:

Code:
function defaultDisplay() {

    global $AllowableHTML, $prefix, $user, $cookie, $anonymous, $currentlang, $multilingual, $db, $module_name, $language;
    include_once('header.php');
    OpenTable();
    echo '<center><p class="title"><b>'._SUBMITNEWS.'</b></p>';
    echo '<p class="content"><i>'._SUBMITADVICE.'</i></p></center>';
    CloseTable();
    echo '<br />';
    OpenTable();
    if (is_user($user)) getusrinfo($user);
    echo '<div class="content"><form action="modules.php?name='.$module_name.'" method="post">'
        .'<p><b>'._YOURNAME.':</b> ';
    if (is_user($user)) {
        cookiedecode($user);
        echo '<a href="modules.php?name=Your_Account">'.$cookie[1].'</a> [ <a href="modules.php?name=Your_Account&amp;op=logout">'._LOGOUT.'</a> ]';
    } else {
        echo $anonymous.' [ <a href="modules.php?name=Your_Account">'._NEWUSER.'</a> ]';
    }
    echo '</p><p>'
        .'<b>'._SUBTITLE.':</b> '
        .'('._BEDESCRIPTIVE.')<br />'
        .'<input type="text" name="subject" size="50" maxlength="80" /><br />('._BADTITLES.')'
        .'</p><p>'
        .'<b>'._TOPIC.':</b> <select name="topic">';
   $new_topic = $_GET['new_topic'];
    if ($new_topic == 32|33|34) {
    $result = $db->sql_query("SELECT 'topicid','topictext' FROM '.$prefix.'_topics WHERE topicid='32,33,34' ORDER BY topictext");
   echo '<option value="" selected="selected">'._SELECTTOPIC.'</option>';
    while ($row = $db->sql_fetchrow($result)) {
        $topicid = intval($row['topicid']);
        $topics = stripslashes(check_html($row['topictext'], 'nohtml'));
        echo '<option value="'.$topicid.'">'.$topics.'</option>';}
}   elseif ($new_topic == 15|14|10|11|12|13|9|39|41|40) {
    $result = $db->sql_query("SELECT topicid, topictext FROM '.$prefix.'_topics WHERE topicid='10,11,12,13,14,15,9,39' ORDER BY topictext");
   echo '<option value="" selected="selected">'._SELECTTOPIC.'</option>';
    while ($row = $db->sql_fetchrow($result)) {
        $topicid = intval($row['topicid']);
        $topics = stripslashes(check_html($row['topictext'], 'nohtml'));
        echo '<option value="'.$topicid.'">'.$topics.'</option>';}
}   elseif ($new_topic == 16|17|18|19|20) {
   $result = $db->sql_query("SELECT topicid, topictext FROM '.$prefix.'_topics WHERE topicid='16,17,18,19,20' ORDER BY topictext");
   echo '<option value="" selected="selected">'._SELECTTOPIC.'</option>';
    while ($row = $db->sql_fetchrow($result)) {
        $topicid = intval($row['topicid']);
        $topics = stripslashes(check_html($row['topictext'], 'nohtml'));
        echo '<option value="'.$topicid.'">'.$topics.'</option>';}
}   elseif ($new_topic == 21|22|23|24|25) {
    $result = $db->sql_query("SELECT topicid, topictext FROM '.$prefix.'_topics WHERE topicid='21,22,23,24,25' ORDER BY topictext");
   echo '<option value="" selected="selected">'._SELECTTOPIC.'</option>';
    while ($row = $db->sql_fetchrow($result)) {
        $topicid = intval($row['topicid']);
        $topics = stripslashes(check_html($row['topictext'], 'nohtml'));
        echo '<option value="'.$topicid.'">'.$topics.'</option>';}
}   elseif ($new_topic == 27|28) {
    $result = $db->sql_query("SELECT topicid, topictext FROM '.$prefix.'_topics WHERE topicid='27,28' ORDER BY topictext");
   echo '<option value="" selected="selected">'._SELECTTOPIC.'</option>';
    while ($row = $db->sql_fetchrow($result)) {
        $topicid = intval($row['topicid']);
        $topics = stripslashes(check_html($row['topictext'], 'nohtml'));
        echo '<option value="'.$topicid.'">'.$topics.'</option>';}
}   elseif ($new_topic == 35|36|37) {
    $result = $db->sql_query("SELECT topicid, topictext FROM '.$prefix.'_topics WHERE topicid='35,36,37' ORDER BY topictext");
   echo '<option value="" selected="selected">'._SELECTTOPIC.'</option>';
    while ($row = $db->sql_fetchrow($result)) {
        $topicid = intval($row['topicid']);
        $topics = stripslashes(check_html($row['topictext'], 'nohtml'));
        echo '<option value="'.$topicid.'">'.$topics.'</option>';}
}
    echo '</select></p><p>';
    if ($multilingual == 1) {
        echo '<b>'._LANGUAGE.': </b>'
            .'<select name="alanguage">';
        $handle=opendir('language');
        $languageslist = '';
        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(!empty($languageslist[$i])) {
            echo '<option value="'.$languageslist[$i].'" ';
            if($languageslist[$i]==$currentlang) echo 'selected="selected"';
            echo '>'.ucfirst($languageslist[$i]).'</option>';
            }
        }
        echo '</select>';
    } else {
        echo '<input type="hidden" name="alanguage" value="'.$language.'" />';
    }
    echo '</p><div>'
        .'<b>'._STORYTEXT.':</b> ('._HTMLISFINE.')<br />';
//    ."<textarea cols=\"50\" rows=\"12\" name=\"story\"></textarea><br />"
    wysiwyg_textarea('story', '', 'NukeUser', '50', '12');
    echo '</div><div><b>'._EXTENDEDTEXT.':</b><br />';
//    ."<textarea cols=\"50\" rows=\"12\" name=\"storyext\"></textarea><br />"
    wysiwyg_textarea('storyext', '', 'NukeUser', '50', '12');
    echo '</div><p>('._AREYOUSURE.')</p><p>'
        ._ALLOWEDHTML.'<br />';
    while (list($key) = each($AllowableHTML)) echo ' &lt;'.$key.'&gt;';
    echo '</p><p><input type="submit" name="op" value="'._PREVIEW.'" />&nbsp;&nbsp;';
    echo '<br />('._SUBPREVIEW.')</p></form></div>';
    CloseTable();
    include_once('footer.php');
}


I solved the problem with the blank page. That was a stupid mistake, and I didn't have my debugging turned on. (DUH! Rolling Eyes )
As for my sub-category workaround, all I get on the Topic selection drop-down is the single checked 'Select Topic'.
Do I need to add $topicid to the globals?
 
montego
PostPosted: Thu Apr 03, 2008 5:46 am Reply with quote

chaoscreator wrote:
Thanks.

Do you know of any module that uses subcategories, other than the Downloads and Weblinks modules?


yet another thread within a thread? <sigh>
 
chaoscreator
PostPosted: Thu Apr 03, 2008 11:58 am Reply with quote

Well, I was trying not to flood the forum with questions. Jeez. Sorry.

I guess it doesn't really matter, anyway. I dropped RavenNuke and went to PHP-Nuke 8.0.
 
montego
PostPosted: Thu Apr 03, 2008 5:46 pm Reply with quote

Well, sorry to hear you say that. You are in for a wild ride... Sad Good luck!
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Blocks

View next topic
View previous topic
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 can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©