Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> v2.4 RN Issues
Author Message
Vampyra
Hangin' Around



Joined: Sep 12, 2004
Posts: 46

PostPosted: Thu Oct 15, 2009 6:06 am Reply with quote

First of all I would like to group more of the modules like forums, etc, under headings - like the Your Account one which has the drop down area from the block.

How do I edit the coding for this and exactly which code bits do I need to edit. I've had a look and I think I know what I need to do but I don't want to mess it up.

Also how could I add small images next to the module titles please?

The next bit is when adding custom fields, I want some of these answers to appear under the posters name and avatar - bit like your location and online status. How can I modifiy the code to capture the reuired fields answer and place it under the posters details on the forums please?

Many thanks.
 
View user's profile Send private message
Palbin
Site Admin



Joined: Mar 30, 2006
Posts: 2583
Location: Pittsburgh, Pennsylvania

PostPosted: Thu Oct 15, 2009 7:37 am Reply with quote

To edit nukeNAV you need to edit includes/jquery/nukeNAV.php and themes/YOUR_THEME/style/nukenav.css


This is a start on displaying the custom fields.
[ Only registered users can see links on this board! Get registered or login! ]

_________________
"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." — Brian W. Kernighan. 
View user's profile Send private message
Vampyra







PostPosted: Thu Oct 15, 2009 11:31 am Reply with quote

Ooh thank you but it's beginning to look scary. I may come back for much more help before I get this sorted.
 
Vampyra







PostPosted: Thu Oct 15, 2009 2:29 pm Reply with quote

OK I have read that post and got a little lost but realise I have to point viewtopic.php to the fid in _users_field_values but I am a little lost with this.

I have this section of code from Ken's Approve Membership module obviously showing the custom fields within the _users table, however, my knowledge is not so great to know how to create the code to point it to both tables and I'm not too sure what what I'm extracting. Ere are the fields thus far - I will add some more but maybe someone would be kind enough to talk me through some of this?

Here's Ken's code:

Code:


//
// Go ahead and pull all data for this topic
//
$sql = "SELECT u.username, u.user_id, u.user_posts, u.user_from, u.custom1, u.custom2, u.custom3, u.custom4, u.custom5, u.custom6, u.custom7, u.custom8, u.custom9, u.custom10, u.custom11, u.custom12, u.custom13, u.custom14, u.custom15, u.custom16, u.custom17, u.custom18, u.custom19, u.custom20, u.custom21, u.custom22, u.custom23, u.custom24, u.user_show_custom1, u.user_show_custom2, u.user_show_custom3, u.user_show_custom4, u.user_show_custom5, u.user_show_custom6, u.user_show_custom7, u.user_show_custom8, u.user_show_custom9, u.user_show_custom10, u.user_show_custom11, u.user_show_custom12, u.user_show_custom13, u.user_show_custom14, u.user_show_custom15, u.user_show_custom16, u.user_show_custom17, u.user_show_custom18, u.user_show_custom19, u.user_show_custom20, u.user_show_custom21, u.user_show_custom22, u.user_show_custom23, u.user_show_custom24, u.user_website, u.user_email, u.user_icq, u.user_aim, u.user_yim, u.user_regdate, u.user_msnm, u.user_viewemail, u.user_rank, u.user_sig, u.user_sig_bbcode_uid, u.user_avatar, u.user_avatar_type, u.user_allowavatar, u.user_allowsmile, p.*, pt.post_text, pt.post_subject, pt.bbcode_uid
        FROM " . POSTS_TABLE . " p, " . USERS_TABLE . " u, " . POSTS_TEXT_TABLE . " pt
        WHERE p.topic_id = '$topic_id'
                $limit_posts_time
                AND pt.post_id = p.post_id
                AND u.user_id = p.poster_id
        ORDER BY p.post_time $post_time_order
        LIMIT $start, ".$board_config['posts_per_page'];
if ( !($result = $db->sql_query($sql)) )
{
        message_die(GENERAL_ERROR, "Could not obtain post/user information.", '', __LINE__, __FILE__, $sql);
}




Should I have here something like:
Code:


 FROM " . POSTS_TABLE . " p, " . USERS_TABLE . " u, " . POSTS_TEXT_TABLE . " pt, " . USERS_FIELD_VALUE . " fid
        WHERE p.topic_id = '$topic_id'
                $limit_posts_time
                AND pt.post_id = p.post_id
                AND u.user_id = p.poster_id
                AND fid = p.poster_id
        ORDER BY p.post_time $post_time_order
        LIMIT $start, ".$board_config['posts_per_page'];
if ( !($result = $db->sql_query($sql)) )
{
        message_die(GENERAL_ERROR, "Could not obtain post/user information.", '', __LINE__, __FILE__, $sql);


Now Palbin gave the other person this clue:

Code:


$result = mysql_query("SELECT * FROM nuke_users_field_values
WHERE uid='48' AND fid='1'")
or die(mysql_error());


and talking about putting it on a loop to capture all extra fields in USERS_FIELD_VALUES.

I know what I have written is wrong so don't shout, let's start from here. Please help me to understand and build this into the RN site.

Thank you.


Here's my current fields in _users_fields_values:

Quote:

vid 1
uid 2
fid 1
value Black & Purple
 
Guardian2003
Site Admin



Joined: Aug 28, 2003
Posts: 6799
Location: Ha Noi, Viet Nam

PostPosted: Thu Oct 15, 2009 3:17 pm Reply with quote

Before you go any further, I don't think you can use Approve Membership mod with RavenNuke (tm) as it is duplicating a lot of code/functionality that is already in RavenNuke (tm) so quoting code from that module is going to confuse anyone trying to help you.
If you are trying to install Approve Membership then this is not really the right forum.
 
View user's profile Send private message Send e-mail
Vampyra







PostPosted: Thu Oct 15, 2009 4:04 pm Reply with quote

No, it's ok I am only looking to that because there maybe some part of the code which can be used. I am not very experienced at writing code from scratch so I am hoping there maybe something from there which might be a basis to start from.

I am not trying to install Approve Membership mod.

I'm really asking for some help because I don't think I can realistically do this myself.

Thank you.
 
Palbin







PostPosted: Thu Oct 15, 2009 4:52 pm Reply with quote

I'm looking at this now. I'll get back to you with something.
 
Palbin







PostPosted: Thu Oct 15, 2009 6:10 pm Reply with quote

This is going to be harder than I thought because we need to selected multiple records in fields table.
 
Vampyra







PostPosted: Fri Oct 16, 2009 3:04 am Reply with quote

Oh I'm sorry. I didn't realise it would be very time consuming. I can live without it if you would prefer? Sad
 
nuken
RavenNuke(tm) Development Team



Joined: Mar 11, 2007
Posts: 2024
Location: North Carolina

PostPosted: Mon Oct 19, 2009 1:22 pm Reply with quote

For your menu, something like Sommaire Menu might be what you are looking for. I have no idea if it will work with RavenNuke 2.40 but it wouldn't hurt to try.

_________________
Tricked Out News 
View user's profile Send private message Send e-mail Visit poster's website
Vampyra







PostPosted: Mon Oct 19, 2009 1:45 pm Reply with quote

Well Nuken, I was looking at the phpBB_2_Main_Menu.php and what I am trying to do is group the sections together with the drop down area found on the Your Account section of the nukeNav block.

This is the very simple coding for phpBB2_Main_Menu.php:

Code:


<?php

/*************************************************************************/
/* phpBB2 Main Menu (Modules Block) for PHP-Nuke 5.6                 */
/* 25 July 2002                                                                                              */
/* By: ThaiNuke (webmaster@thainuke.net)                                           */
/* http://www.thainuke.net                                                                           */
/* Copyright © 2002 by PHP-Nuke Thailand                                            */
/* Based on the block-Modules                                                                 */
/*************************************************************************/

if (eregi("block-phpBB2_Main_Menu.php", $PHP_SELF)) {
    Header("Location: index.php");
    die();
}

global $prefix, $dbi, $admin;

$result = sql_query("select main_module from ".$prefix."_main", $dbi);
list($main_module) = sql_fetch_row($result, $dbi);
$result = sql_query("select title from ".$prefix."_modules", $dbi);
while (list($title) = sql_fetch_row($result, $dbi)) {
    $a = 0;
    $handle=opendir('modules');
    while ($file = readdir($handle)) {
        if ($file == $title) {
   $a = 1;
   }
    }
    closedir($handle);
    if ($a == 0) {
        sql_query("delete from ".$prefix."_modules where title='$title'", $dbi);
   }
    }

/* News */
$content = "<img src=images/blocks/21.gif><B> "._BHOME1." :</B><BR><BR>\n";
$content .= "<img src=images/blocks/icon_dot.gif> <a href=\"index.php\">"._BHOME2."</a></strong><BR>\n";


/*$content .= "<img src=images/blocks/icon_dot.gif> <a href=\"modules.php?name=Guestbook\">".Guestbook."</a><BR>\n";*/

$content .= "<img src=images/blocks/icon_dot.gif> <a href=\"archive.html\">"._BARCHIVE."</a><BR>\n";
$content .= "<img src=images/blocks/icon_dot.gif> <a href=\"search.html\">"._BSEARCH."</a><BR>\n";
$content .= "<img src=images/blocks/icon_dot.gif> <a href=\"surveys.html\">"._BPOLL."</a><BR>\n";



/*Inner Sanctum*/
$content .= "<img src=images/blocks/21.gif><B> "._BMEMBER1." :</B><BR><BR>\n";

$content .= "<img src=images/blocks/icon_dot.gif> <a href=\"modules.php?
name=Your_Account\">"._BLOGIN."</a><BR>\n";
$content .= "<img src=images/blocks/icon_dot.gif> <a href=\"modules.php?
name=Forums\">"._BFORUM."</a><BR>\n";
$content .= "<img src=images/blocks/icon_dot.gif> <a href=\"modules.php?
name=coppermine\">"._BGALL."</a><BR>\n";
$content .= "<img src=images/blocks/icon_dot.gif> <a href=\"modules.php?
name=Journal\">"._JOURNAL."</a><BR>\n";



/*Awards
$content .= "<img src=images/blocks/21.gif><B> ".Awards." :</B><BR><BR>\n";

$content .= "<img src=images/blocks/icon_dot.gif> <a href=\"modules.php?
name=Content&pa=showpage&pid=5\">"._B4US1."</a><BR>\n";
$content .= "<img src=images/blocks/icon_dot.gif> <a href=\"modules.php?
name=Content&pa=showpage&pid=4\">"._B4U."</a><BR>\n";*/



/*Scrolls*/

$content .= "<img src=images/blocks/21.gif><B> ".Scrolls." :</B><BR><BR>\n";
$content .= "<img src=images/blocks/icon_dot.gif> <a href=\"modules.php?
name=Submit_News\">"._BSUBMITN."</a><BR>\n";
$content .= "<img src=images/blocks/icon_dot.gif> <a href=\"modules.php?
name=Reviews&rop=write_review\">"._BSUBREV."</a><BR>\n";
$content .= "<img src=images/blocks/icon_dot.gif> <a href=\"reviews.html\">"._BREVIEW."</a><BR>\n";
$content .= "<img src=images/blocks/icon_dot.gif> <a href=\"recommend.html\">"._BREC."</a><BR>\n";
$content .= "<img src=images/blocks/icon_dot.gif> <a href=\"content.html\">"._BRESMUS."</a><BR>\n";
$content .= "<img src=images/blocks/icon_dot.gif> <a href=\"feedback.html\">"._BFEEDBACK."</a><BR>\n";


/* Web Link */
$content .= "<img src=images/blocks/21.gif> <a href=\"links.html\">"._BLINK."</a><BR><BR>\n";


/*$content .= "<img src=images/blocks/icon_dot.gif> <a href=\"modules.php?name=MS_TopSites\">".GothVampTopSites."</a><BR>\n";*/


$content .= "<img src=images/blocks/icon_dot.gif> <a href=\"modules.php?name=Web_Links&file=index&l_op=AddLink\">"._BADDL."</a><BR>\n";
$content .= "<img src=images/blocks/icon_dot.gif> <a href=\"modules.php?name=Web_Links&file=index&l_op=MostPopular\">"._BPOP."</a><BR>\n";
$content .= "<img src=images/blocks/icon_dot.gif> <a href=\"modules.php?name=Web_Links&file=index&l_op=TopRated\">"._BRATE."</a><BR>\n";





/* Stats */
$content .= "<img src=images/blocks/icon_poll.gif><B> "._BSTAT1." :</B><BR>\n";
$content .= "<img src=images/blocks/icon_dot.gif> <a href=\"stats.html\">"._BSTAT2."</a><BR>\n";
$content .= "<img src=images/blocks/icon_dot.gif> <a href=\"top.html\">"._BTOP."</a><BR>\n";



/* For Admin
 if (is_admin($admin)) {
   $handle=opendir('modules');
   while ($file = readdir($handle)) {
       if ( (!ereg("[.]",$file)) ) {
      $modlist .= "$file ";
       }
   }
   closedir($handle);
   $modlist = explode(" ", $modlist);
   sort($modlist);
   for ($i=0; $i < sizeof($modlist); $i++) {
       if($modlist[$i] != "") {
      $result = sql_query("select mid from ".$prefix."_modules where title='$modlist[$i]'", $dbi);
      list ($mid) = sql_fetch_row($result, $dbi);
      if ($mid == "") {
          sql_query("insert into ".$prefix."_modules values (NULL, '$modlist[$i]', '$modlist[$i]', '0', '0')", $dbi);
      }
       }
   }
   $content .= "<br><center><img src=images/blocks/icon_modules.gif> <b>"._NOACTIVEMODULES.":</b><br>";
   $content .= "<font class=\"tiny\">"._FORADMINTESTS."</font><br>";
   $content .= "<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0><TR><FORM METHOD=GET ACTION=\"modules.php\"><TD><img src=images/blocks/icon_select.gif> <SELECT NAME=\"name\" CLASS=\"boxcontent\" onChange=\"submit()\"><OPTION VALUE=\"\">"._BSELECT."";
   $result = sql_query("select title, custom_title from ".$prefix."_modules where active='0' ORDER BY title ASC", $dbi);
    while(list($mn_title, $custom_title) = sql_fetch_row($result, $dbi)) {
   $mn_title2 = ereg_replace("_", " ", $mn_title);
   if ($custom_title != "") {
       $mn_title2 = $custom_title;
   }
   $content .= "<OPTION VALUE=\"$mn_title\">$mn_title2\n";
   $a = 1;
    }
    if ($a != 1) {
        $content .= "<OPTION VALUE=\"\">"._NONE."\n";
   }
   $content .= "</SELECT></TD></TR></FORM></TABLE>";
    }*/

?>


As you can see there are sections grouped together and what I wish to do is have all these sections behave like this:

Code:


if (is_user($user)) {
            $content .= '<ul>';
            if (is_active('Private_Messages')) $content .= '<li><a href="modules.php?name=Private_Messages" title="">Private Messages</a></li>';
            $content .= '<li><a href="modules.php?name=Your_Account&amp;op=edituser" title="">Preferences</a></li>';
            if ($ya_config['allowusertheme']=='1') $content .= '<li><a href="modules.php?name=Your_Account&amp;op=chgtheme" title="">Change Theme</a></li>';
            $content .= '<li><a href="modules.php?name=Your_Account&amp;op=logout" title="">Logout</a></li></ul>';
         } else {
            $content .= '
            <ul>
            <li><a href="modules.php?name=Your_Account" title="">Login</a></li>';
            if ($ya_config['allowuserreg']=='1') $content .= '
            <li><a href="modules.php?name=Your_Account&amp;op=new_user" title="">Register</a></li>';
            $content .= '
            </ul>';
         }
      }
      $content .= "</li>\n";
  }
   $la = $active; $lim = $inmenu;
}


where Your Account drops down with PM's, Preferences, Change Theme and Logout - I would like a drop down menu from News, from Inner Sanctum, from Awards, from Scrolls, from Web Links and from Stats. I would also like to include the graphic you can see attached to those titles.

I realise phpBB_Main_Menu.php is just pointing to module links and nukeNav appears to be pointing to db entries.

I hope I'm being clear, I just want 5 titles in the nukeNav box and as you roll over them for the submenus to drop down - just like the Your Account currently does on the nukeNav.

This might be very simple and I am being very blonde Embarassed - literally just replicating the Your Account code and pointing to renamed modules, but I would love a little help with this please.

Thank you.
 
Guardian2003







PostPosted: Mon Oct 19, 2009 2:20 pm Reply with quote

Hold it right there.
The script you posted uses the antiquated $dbi database abstraction layer, so that won't work without recoding it and it also references stuff that doesn't exist (Guestbook for one) I do not recommend that file is used at all without it being reworked.

nukeNav (the side menu block) points to DB entries because I believe it is built dynamically from whatever modules you have installed and take into account if they are active, hidden, etc.
I have not actually looked at the file yet but I will do now.
Just to be clear, you are needing to add links in the side menu block, not the header menu?
 
Vampyra







PostPosted: Mon Oct 19, 2009 2:34 pm Reply with quote

Hi Guardian.

Thank you for looking at this.

This is my old menu, (second block down), on the site which is currently live - not the RN site:
[ Only registered users can see links on this board! Get registered or login! ]

My header menu bar on the new RN site is the same as this old one.

What I would like to do is get those titles in the nukeNav block, i.e. Home, News, Inner Sanctum, etc, as highlighted in the old $dbi text, but obviously to work with nukeNav.

You mention Guestbook - for various reasons I have a Bravenet Guestbook, least of all because I have had so many spammings and hacking through the phpNuke ones. Can I include links to files or HTML pages which are outside the RN portal within nukeNav?

Or maybe I should include a sperate block for such things and just use php code to point to them? Maybe that would be easier.

Please forgive my ignorance for more "modern" php coding - I am searching these forums and trying to learn. I did realise this ran on old $dbi abstraction layer but I am feeling rather like a fish out of water at the moment. I'm sure I will pick it up but til then I may ask some real dumb questions, for which I can only apologise.

Many thanks
 
nuken







PostPosted: Mon Oct 19, 2009 2:44 pm Reply with quote

nukeNAV does not have the ability to do that just yet. It looks as if your site used the Sommaire Paramétrable menu block. It should work with RavenNuke 2.40, if you give me a few minutes I will test it. It can be downloaded from Montego's site. With that menu block, you can add external links easily. Also, if you want to make a menu for external links, you can use the blocks admin to make one using the nukeWYSIWYG editor.
 
Guardian2003







PostPosted: Mon Oct 19, 2009 2:55 pm Reply with quote

No problem at all with you asking questions and thanks for clarifying things, I will be gentle I promise Smile

I would recommend you make a seperate block for those links so that if/when you perform any updates/upgrades on your site in the future, you shouldn't lose anything. Sure, it would look nicer in the nukeNAV block but every time you customise something by altering the core code you are adding to the maintenance nightmare whenever you do an update/upgrade because you have to remember every file you changed, why you changed it ......

If you need help with making a new block, mail me your old one and tell me which links you need to keep and I'll make it for you.
 
Vampyra







PostPosted: Mon Oct 19, 2009 2:59 pm Reply with quote

Nuken it's not that one, it was just called phpBB2_Main_Menu block. It's quite old but I have been using and editing it for some time.

I've never tried Sommaire Paramétrable menu block but would be willing to try.

What a shame about nukeNav - it's looks so nice and maybe you can see what I mean about how it would look great with the drop down menus.

I wish I was much better at coding as I would be willing to re-write stuff, but I wouldn't know where to start. Is there a book for php code which would be helpful with RN?
 
nuken







PostPosted: Mon Oct 19, 2009 3:02 pm Reply with quote

OK, I thought it was Sommaire. I just installed it on my test site and found a couple of small issues. I will have it fixed in a bit and post a link to it in this forum.
 
Vampyra







PostPosted: Mon Oct 19, 2009 3:13 pm Reply with quote

OK thanks Guardian that's great.

I'm just going to grab something to eat and I'll mail you a little later.

Thank you.

Hold on just before I go - I can change module names and the new names will show up in nukeNav, correct?

So am I right in thinking because nukeNav is db based, you can group certain things under the heading Your Account because those actions can be performed from the Your Account module, e.g. Theme Change, etc, but all the other modules are just effectively stand alone and have no sub menus? And thus to be able to custom group them you would have to create a seperate dbase table where an Admin could custom group the modules then create a new table title for every group? Then nukeNav could point to those custom tables? Am I barking up the wrong tree? I couldn't create it but I'm just curious as to how you could do this. Would be marvellous.
 
Guardian2003







PostPosted: Mon Oct 19, 2009 3:39 pm Reply with quote

Yes, if you go to your main administration area and give each module a custom title, nukeNAV (tm) will update to use the custom titles.
The 'grouping' of those specific links in the side menu block is because it was specifically designed/written to do it that way for those links as they are related - it's more efficient to use a sub menu for those links so it was written specifically to do it that way.
 
nuken







PostPosted: Mon Oct 19, 2009 3:54 pm Reply with quote

Here is a link to download Sommaire Parametrable for RavenNuke. It tested out ok on my test site. There may be some bugs with it, but none major.

http://trickedoutnews.com/download-file-70.html
 
Vampyra







PostPosted: Mon Oct 19, 2009 4:37 pm Reply with quote

Thank you Nuken - will give this a go.

I'll send you the .php file for the other block, Guardian - if you can get it to work then it will be another blcok that specifically works with RN. It's easily customisable for idiots like me too! LOL Wink
 
kguske
Site Admin



Joined: Jun 04, 2004
Posts: 6433

PostPosted: Tue Oct 20, 2009 4:47 am Reply with quote

Just a suggestion: you could also create an HTML block, even one that uses the nukeNAV menu capabilities...

_________________
I search, therefore I exist...
nukeSEO - nukeFEED - nukePIE - nukeSPAM - nukeWYSIWYG
 
View user's profile Send private message
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> v2.4 RN Issues

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 ©