SimplePortal
Customization => Custom Coding => Topic started by: james-at on April 11, 2011, 08:19:42 AM
-
I need get it block with php code
(http://i53.tinypic.com/2mxlxfb.jpg)
xample from: http://foro.red-g.net (http://foro.red-g.net)
Thanks o.o
-
You want just a list of links?
-
You want just a list of links?
Yes, A code for Showautomaticly the Links of the all Categories and all Forums, Its obviously, regards
-
I would start with a call to getBoardIndex. (you can see how it is called in BoardIndex.php).
Then, I would look at template.BoardIndex.php to see how that information is written out with echo.
You want a very abbreviated format, of course, so you would copy that and then take a lot away from it.
This is definitely a little custom coding project.
-
I would start with a call to getBoardIndex [...]
getBoardIndex call? : '(
I am newbie in php. could explain it better?
PS: There was a mod that supposedly made all it easier (SP Navigation Block http://simpleportal.net/index.php?topic=1532.0) But was created for an older version of SimplePortal. Could you help me adapt it to this new version, and thus be useful for the community?
Regards [-:
-
Thanks for ignore me :(
-
As there is no money for a 24/7 support staff, we are a spread a bit thin at SimplePortal.net.
What you have is a custom coding project, rather than a SimplePortal support issue.
My first advice is to read about php, HTML, and CSS at someplace like w3schools.com.
I would like your request to attract the attention of someone who has done this kind of custom coding before.
I think the most sensible thing to do is to move it to a custom coding board.
What do you think?
-
I would like your request to attract the attention of someone who has done this kind of custom coding before.
I think the most sensible thing to do is to move it to a custom coding board.
What do you think?
You're right. Should approach the person who has worked on this code before.
Well, I just resolved the issue myself. 8)
I made a small modification to the original code.
SP Navigation Block for SimplePortal 2.3.3 (Modified by jAmsx)
1. Go to Add block > Custom Php Code >
2. Paste the next code:
global $cat_tree, $boards, $boardList, $scripturl, $sourcedir, $user_info, $db_prefix;
$block_parameters = array(
'num_children' => 'int',
);
if ($return_parameters)
return $block_parameters;
$child_depth = !empty($parameters['num_children']) ? (int) $parameters['num_children'] - 1 : -1;
require_once($sourcedir . '/Subs-Boards.php');
getBoardTree();
// Remobe any boards this user can't actually see.
$temp_boards = $boards;
$request = db_query("
SELECT b.ID_BOARD
FROM {$db_prefix}boards AS b
WHERE !($user_info[query_see_board])", __FILE__, __LINE__);
while ($row = mysql_fetch_assoc($request))
unset($temp_boards[$row['ID_BOARD']]);
mysql_free_result($request);
echo '
<div style="padding-left:2px;">';
foreach ($cat_tree as $catid => $tree)
{
echo '
<span class="sp_navigation_block_cat" style="font-weight:bold;"><a href="', $scripturl, '?action=forum#', $tree['node']['id'], '">', $tree['node']['name'], '</a></span><br />';
foreach ($boardList[$catid] as $boardid)
{
$prefix = '';
for ($i=0; $i<=$boards[$boardid]['level']; $i++)
$prefix .= '-';
echo '
', $prefix, '<span class="sp_navigation_block_board"><a href="', $scripturl, '?board=', $boards[$boardid]['id'], '">', $boards[$boardid]['name'], '</a></span><br />';
}
}
echo '
</div>';
This work pefectly. Check my portal: http://www.darksitel.com/index.php
Regards.
-
How can i do this so it does not show the child boards ?
-
I would like your request to attract the attention of someone who has done this kind of custom coding before.
I think the most sensible thing to do is to move it to a custom coding board.
What do you think?
You're right. Should approach the person who has worked on this code before.
Well, I just resolved the issue myself. 8)
I made a small modification to the original code.
SP Navigation Block for SimplePortal 2.3.3 (Modified by jAmsx)
1. Go to Add block > Custom Php Code >
2. Paste the next code:
global $cat_tree, $boards, $boardList, $scripturl, $sourcedir, $user_info, $db_prefix;
$block_parameters = array(
'num_children' => 'int',
);
if ($return_parameters)
return $block_parameters;
$child_depth = !empty($parameters['num_children']) ? (int) $parameters['num_children'] - 1 : -1;
require_once($sourcedir . '/Subs-Boards.php');
getBoardTree();
// Remobe any boards this user can't actually see.
$temp_boards = $boards;
$request = db_query("
SELECT b.ID_BOARD
FROM {$db_prefix}boards AS b
WHERE !($user_info[query_see_board])", __FILE__, __LINE__);
while ($row = mysql_fetch_assoc($request))
unset($temp_boards[$row['ID_BOARD']]);
mysql_free_result($request);
echo '
<div style="padding-left:2px;">';
foreach ($cat_tree as $catid => $tree)
{
echo '
<span class="sp_navigation_block_cat" style="font-weight:bold;"><a href="', $scripturl, '?action=forum#', $tree['node']['id'], '">', $tree['node']['name'], '</a></span><br />';
foreach ($boardList[$catid] as $boardid)
{
$prefix = '';
for ($i=0; $i<=$boards[$boardid]['level']; $i++)
$prefix .= '-';
echo '
', $prefix, '<span class="sp_navigation_block_board"><a href="', $scripturl, '?board=', $boards[$boardid]['id'], '">', $boards[$boardid]['name'], '</a></span><br />';
}
}
echo '
</div>';
This work pefectly. Check my portal: http://www.darksitel.com/index.php
Regards.
Dont works with version 2.3.5 :(
-
Can anyone update this to version 2.3.5'
Thanks.