collapse

* Simple Portal Archived Forum

This is an Archive Forum.

The content in this forum may be out-of-date or have been superseded by newer information, and links in forum pages to other sites may not work.
This forum contains archives for future reference.

Visit our thread at Simple Machines Forum for current support.

SMF 2.1 users: EhPortal is a ported version of Simple Portal specifically designed for the SMF 2.1 branch.
Please visit web-develop.ca to download EhPortal and for its support.

* User Info

 
 
Welcome, Guest. Please login or register.

* Who's Online

  • Dot Guests: 273
  • Dot Hidden: 0
  • Dot Users: 0

There aren't any users online.

* Shoutbox

Refresh History
  • Shoutbox is not for support!
  • {OCS}MasterSeal: Yup, Still adore SP
    April 21, 2019, 07:08:06 PM
  • {OCS}MasterSeal: STILL love SP :)
    November 24, 2018, 05:05:50 AM
  • ♦ Ninja ZX-10RR ♦: <3 aegersz
    September 13, 2018, 03:36:09 PM
  • aegersz: I STILL <3 LOVE SimplePortal
    September 13, 2018, 07:11:39 AM
  • aegersz: o LOVE you guys - Simple Portal rocks !
    May 09, 2018, 05:18:59 AM
  • Chen Zhen: our apologies for the site being down.. please read server issues topic
    March 22, 2018, 05:32:38 AM
  • {OCS}MasterSeal: LOL PLEASE forget I just posted that. I found the answer in my own dang post back in 2015. lol sorry!
    July 04, 2017, 10:47:55 PM
  • {OCS}MasterSeal: I know this SB isnt' for support, but I just have a general question. Who would I contact to find out where SP stores its block info? Is it DB driven or files? I searched the site but came up with nothing. probably my fault any insight is appreciated.
    July 04, 2017, 10:43:36 PM
  • ♦ Ninja ZX-10RR ♦: Excuse me but what does Simpleportal have to deal with that?
    February 05, 2017, 08:21:14 PM
  • WhiteEagle: of course IMHO that site appears to be dead :(
    February 04, 2017, 01:08:05 PM
  • WhiteEagle: If I can get that, then I'll use it for that site...
    February 04, 2017, 01:07:35 PM
  • WhiteEagle: decided to not use SMF for any projects, unless I can get a copy of the premium version of the fanfiction archive plugin
    February 04, 2017, 01:06:54 PM
  • expertdecisions: cloudflare
    January 28, 2017, 08:01:47 AM
  • aegersz: SM release 2.0.13 !
    January 12, 2017, 06:00:13 AM
  • raffo: Tks Emanuele, even if I didn't understand the fix :D
    November 07, 2016, 02:01:20 AM
  • emanuele: [link]
    November 01, 2016, 12:43:50 PM
  • emanuele: raffo: the English support board is a good place. ;)
    November 01, 2016, 12:43:38 PM
  • raffo: Where can I find the fix for the shoutbox?
    November 01, 2016, 05:06:09 AM
  • {OCS}MasterSeal: To the SP team, I make a point to come here and thank you as much as possible for your work.  so again, THANK YOU!
    October 28, 2016, 10:38:05 AM
  • emanuele: That's indeed funny, the limit is present only in the patch and not the full install.
    October 22, 2016, 06:14:58 PM

* Recent Posts

Adding Forums Button to Nav bar by jirapon
[August 01, 2019, 09:07:12 AM]


Re: Board Icons by ♦ Ninja ZX-10RR ♦
[July 30, 2019, 04:03:41 PM]


MOVED: Czech translation???? by ♦ Ninja ZX-10RR ♦
[July 30, 2019, 03:04:51 PM]


Board Icons by jirapon
[July 30, 2019, 07:28:44 AM]


Re: Thankyou Simpleportal, by ♦ Ninja ZX-10RR ♦
[July 29, 2019, 09:41:29 AM]

NEED HELP? If you're looking for support with Simple Portal, look no further than the Support Board!

Author Topic: anyone know how to do this?  (Read 5165 times)

0 Members and 1 Guest are viewing this topic.

Offline immaturity

  • Newbie
  • Posts: 3
anyone know how to do this?
« on: September 06, 2008, 12:27:35 PM »
Right now I update our site's menu by hand, you can see at http://forum.parentalplayground.com

I will be installing simple portal next week-ish and working on my site a lot after that, and I am trying to figure out a way to do this...
1. Get the article categories and articles to be listed using the same kind of menu I already use on the left hand side. What it does it list the categories, and when you click on a category title it drops open to show the articles.

this is the script I currently use and update in my template whenever I have new content/articles: http://www.dynamicdrive.com/dynamicindex17/ddaccordionmenu-bullet.htm

If someone can figure this out I'd love it! Like I said, I won't be starting my overhaul of the site for another week or so.

Offline [SiNaN]

  • Mr. SimplePortal
  • Developer
  • *
  • Posts: 6782
  • SMF Version: 2.0.15
  • SP Version: 2.3.7
Re: anyone know how to do this?
« Reply #1 on: September 17, 2008, 09:28:23 AM »
I liked the view and the idea. Will check this when I get home.
And slowly, you come to realize... It's all as it should be...

Offline [SiNaN]

  • Mr. SimplePortal
  • Developer
  • *
  • Posts: 6782
  • SMF Version: 2.0.15
  • SP Version: 2.3.7
Re: anyone know how to do this?
« Reply #2 on: September 19, 2008, 04:14:05 AM »
Okay, use this code in a php block:

Code: [Select]
global $db_prefix, $context, $user_info, $scripturl, $settings;

echo '
<script type="text/javascript" src="', $settings['theme_url'], '/jquery-1.2.2.pack.js"></script>

<script type="text/javascript" src="', $settings['theme_url'], '/ddaccordion.js">

/***********************************************
* Accordion Content script- (c) Dynamic Drive DHTML code library (www.dynamicdrive.com)
* Visit http://www.dynamicDrive.com for hundreds of DHTML scripts
* This notice must stay intact for legal use
***********************************************/

</script>


<script type="text/javascript">


ddaccordion.init({
headerclass: "expandable", //Shared CSS class name of headers group that are expandable
contentclass: "categoryitems", //Shared CSS class name of contents group
revealtype: "click", //Reveal content when user clicks or onmouseover the header? Valid value: "click" or "mouseover
collapseprev: true, //Collapse previous content (so only one open at any time)? true/false
defaultexpanded: [0], //index of content(s) open by default [index1, index2, etc]. [] denotes no content
onemustopen: false, //Specify whether at least one header should be open always (so never all headers closed)
animatedefault: false, //Should contents open by default be animated into view?
persiststate: true, //persist state of opened contents within browser session?
toggleclass: ["", "openheader"], //Two CSS classes to be applied to the header when it\'s collapsed and expanded, respectively ["class1", "class2"]
togglehtml: ["prefix", "", ""], //Additional HTML added to the header when it\'s collapsed and expanded, respectively  ["position", "html1", "html2"] (see docs)
animatespeed: "normal", //speed of animation: "fast", "normal", or "slow"
oninit:function(headers, expandedindices){ //custom code to run when headers have initalized
//do nothing
},
onopenclose:function(header, index, state, isuseractivated){ //custom code to run whenever a header is opened or closed
//do nothing
}
})


</script>

<style type="text/css">

.arrowlistmenu{
width: 180px; /*width of accordion menu*/
}

.arrowlistmenu .menuheader{ /*CSS class for menu headers in general (expanding or not!)*/
font: bold 14px Arial;
color: white;
background: black url(', $settings['theme_images_url'], '/titlebar.png) repeat-x center left;
margin-bottom: 10px; /*bottom spacing between header and rest of content*/
text-transform: uppercase;
padding: 4px 0 4px 10px; /*header text is indented 10px*/
cursor: hand;
cursor: pointer;
}

.arrowlistmenu .openheader{ /*CSS class to apply to expandable header when it\'s expanded*/
background-image: url(', $settings['theme_images_url'], '/titlebar-active.png);
}

.arrowlistmenu ul{ /*CSS for UL of each sub menu*/
list-style-type: none;
margin: 0;
padding: 0;
margin-bottom: 8px; /*bottom spacing between each UL and rest of content*/
}

.arrowlistmenu ul li{
padding-bottom: 2px; /*bottom spacing between menu items*/
}

.arrowlistmenu ul li a{
color: #A70303;
background: url(', $settings['theme_images_url'], '/arrowbullet.png) no-repeat center left; /*custom bullet list image*/
display: block;
padding: 2px 0;
padding-left: 19px; /*link text is indented 19px*/
text-decoration: none;
font-weight: bold;
border-bottom: 1px solid #dadada;
font-size: 90%;
}

.arrowlistmenu ul li a:visited{
color: #A70303;
}

.arrowlistmenu ul li a:hover{ /*hover state CSS*/
color: #A70303;
background-color: #F3F3F3;
}

</style>';

$request = db_query("
SELECT ID_CATEGORY, name
FROM {$db_prefix}sp_categories
WHERE publish = 1
AND articles > 0
ORDER BY ID_CATEGORY", __FILE__, __LINE__);
$return = array();
while ($row = mysql_fetch_assoc($request))
{
$categories[] = array(
'id' => $row['ID_CATEGORY'],
'name' => $row['name'],
);
}
mysql_free_result($request);

foreach($categories as $key => $category)
{
$request = db_query("
SELECT m.subject, t.ID_TOPIC
FROM {$db_prefix}sp_articles AS a
LEFT JOIN {$db_prefix}messages AS m ON (m.ID_MSG = a.ID_MESSAGE)
LEFT JOIN {$db_prefix}topics AS t ON (t.ID_FIRST_MSG = a.ID_MESSAGE)
LEFT JOIN {$db_prefix}boards AS b ON (b.ID_BOARD = m.ID_BOARD)
WHERE $user_info[query_see_board]
AND a.ID_CATEGORY = $category[id]
ORDER BY a.ID_MESSAGE DESC", __FILE__, __LINE__);
while ($row = mysql_fetch_assoc($request))
{
$categories[$key]['articles'][] = '<a href="' . $scripturl . '?topic=' . $row['ID_TOPIC'] . '.0">' . $row['subject'] . '</a>';
}
mysql_free_result($request);
}

echo '
<div class="arrowlistmenu">';

foreach($categories as $category)
{
echo '
<h3 class="menuheader expandable">', $category['name'], '</h3>
<ul class="categoryitems">';

foreach($category['articles'] as $article)
echo '
<li>', $article, '</li>';

echo '
</ul>';
}

echo '
</div>';

Copy js files to default theme directory and images to default theme images directory.
And slowly, you come to realize... It's all as it should be...

Offline Cyst

  • Semi Newbie
  • *
  • Posts: 31
Re: anyone know how to do this?
« Reply #3 on: September 19, 2008, 04:45:17 AM »
This is really interesting.
Have you guys ever thought about having an expandable box option for users? Or even something where users can display whichever boxes they want from a list and move them around to whichever positions they want - sort of like the Google custom pages.

That would certainly be something. I've seen the option for force block but I wasn't sure what that did... I assuse it's not the same thing.

I'd really love to have either of the two.

Offline Nathaniel

  • Comrade
  • *
  • Posts: 5203
  • Gender: Male
    • Verbtest.com
  • SMF Version: 2 RC4
  • SP Version: 2.3.3
Re: anyone know how to do this?
« Reply #4 on: September 19, 2008, 04:59:47 AM »
That is a very interesting idea. The next version of Simple Portal has javascript collapsing for every block so your users can collapse them, it also has a 'Not Collapsable:' option which replaces the redundant 'Force Block:' setting.

We are trying to make the portal easier for you to customize, and easier for your users to customize if you allow them. One of the ideas tossed around, was a simple area for users to choose some blocks to be hidden from their 'Profile' pages, but we are open to other ideas. ;)
SMF Friend (Former Support Specialist) | SimplePortal DeveloperMy SMF Mods | SimplePortal"Quis custodiet ipsos custodes?" - Who will Guard the Guards?Please don't send me ANY support related PMs. I will just delete them.

Offline Cyst

  • Semi Newbie
  • *
  • Posts: 31
Re: anyone know how to do this?
« Reply #5 on: September 19, 2008, 05:42:02 AM »
The javascript collapsing option sounds great, can't wait to see that.

Letting users be able to remove or move blocks would be pretty cool. I know a few of my users asked for me to move certain blocks higher up the list of blocks, but the majority have wanted it to stay the same. It would rememdy that sort of thing :)

Of course some blocks would have to be locked in place... for example articles.

Offline immaturity

  • Newbie
  • Posts: 3
Re: anyone know how to do this?
« Reply #6 on: September 29, 2008, 11:22:45 AM »
thanks for the replies! I will try that java block and then come back to let everyone know how it works. probably not for a few more days.
;)

Offline Nathaniel

  • Comrade
  • *
  • Posts: 5203
  • Gender: Male
    • Verbtest.com
  • SMF Version: 2 RC4
  • SP Version: 2.3.3
Re: anyone know how to do this?
« Reply #7 on: November 13, 2008, 06:49:17 PM »
Did you have any luck with it immaturity? Do you still require help?
SMF Friend (Former Support Specialist) | SimplePortal DeveloperMy SMF Mods | SimplePortal"Quis custodiet ipsos custodes?" - Who will Guard the Guards?Please don't send me ANY support related PMs. I will just delete them.

Offline immaturity

  • Newbie
  • Posts: 3
Re: anyone know how to do this?
« Reply #8 on: December 31, 2008, 04:43:12 PM »
Sorry. I am FINALLY back with a working home computer. My hard drive got fried from a bad power cord shortly after my last post, so I was sharing my husband's computer until now.

So I never got a chance to test this. I finally got simple portal installed on the forum only to realize it doesn't have all of the features I need. :( I wanted to be able to create pages in addition to articles, and it looks like SP would be best for a less complicated site.

BUT THANK YOU SO VERY MUCH. I'll be keeping SP in mind for other projects for sure, it just doesn't have everything I need for the current project.

Offline [SiNaN]

  • Mr. SimplePortal
  • Developer
  • *
  • Posts: 6782
  • SMF Version: 2.0.15
  • SP Version: 2.3.7
Re: anyone know how to do this?
« Reply #9 on: January 01, 2009, 07:30:33 AM »
Thanks for using SimplePortal immaturity.
And slowly, you come to realize... It's all as it should be...