View Single Category

Started by dougiefresh, October 06, 2006, 12:19:19 AM

Previous topic - Next topic

SleePy

As said in the other topic, please try again :)
Jeremy D ~ Site Team / SMF Developer ~ GitHub Profile ~ Join us on IRC @ Libera.chat/#smf ~ Support the SMF Support team!

scoops09

Ok I just found this mod a couple days ago and it's exactly what I've been needing. However, I am having an issue and I apologize if it has already been asked.

I'm running the PortaMx portal and when I click on a category it just brings me to my portal page. The mod works perfectly when I turn off the portal but that isn't an option. I even tried it with other portals but the same thing happened.

I'm very much a novice when it comes to coding, so can someone tell me/show me what I need to do to fix this? I'm so excited about this mod! I can't stress enough how much this mod means to me & my site!

Thanks in advance for any help.

Hoodie

Quote from: scoops09 on December 08, 2009, 07:45:18 PM
Ok I just found this mod a couple days ago and it's exactly what I've been needing. However, I am having an issue and I apologize if it has already been asked.

I'm running the PortaMx portal and when I click on a category it just brings me to my portal page. The mod works perfectly when I turn off the portal but that isn't an option. I even tried it with other portals but the same thing happened.

I'm very much a novice when it comes to coding, so can someone tell me/show me what I need to do to fix this? I'm so excited about this mod! I can't stress enough how much this mod means to me & my site!

Thanks in advance for any help.

I'm getting the same thing using PortaMX..

scoops09

Quote from: Automotive Nation on December 08, 2009, 09:55:26 PM
I'm getting the same thing using PortaMX..

This mod means so much to me that I uninstalled PortaMX and tried Simple Portal & EzPortal but the same thing happened while using those portals as well. I need this mod to work in the worst possible way!

If you find anything out on how to make it work, please let me know. I'll make sure to do the same if I find anything out! I'm hoping someone out there can help!

SleePy

Give this a try.  Install both mods.

Open BoardIndex.php and find:

// Get out of this mess.
redirectexit('c=' . $_REQUEST['c_redirect']);


Then replace that with:

// Get out of this mess.
redirectexit((!empty($context['TPortal']) || defined('PortaMx') ? 'action=forum;' : '') . 'c=' . $_REQUEST['c_redirect']);


Let me know if that works.  If it does I will work on fixing this with the rest of the code and update the mod.
Jeremy D ~ Site Team / SMF Developer ~ GitHub Profile ~ Join us on IRC @ Libera.chat/#smf ~ Support the SMF Support team!

scoops09

Thanks to SunKing, this problem is solved! This code works on both Simple Portal and PortaMx! I'm not sure exactly what he did so I'm just pasting the entire block he tweaked. I knew this was going to be an awesome mod and boy was I right! This is perfect for people who have a ton of categories & topics - Thanks SleePy!

// Run through the categories and boards (or only boards)....
while ($row_board = $smcFunc['db_fetch_assoc']($result_boards))
{
if ($boardIndexOptions['include_categories'])
{
$ignoreThisBoard = in_array($row_board['id_board'], $user_info['ignoreboards']);
$row_board['is_read'] = !empty($row_board['is_read']) || $ignoreThisBoard ? '1' : '0';
// Haven't set this category yet.
if (empty($categories[$row_board['id_cat']]))
{
$categories[$row_board['id_cat']] = array(
'id' => $row_board['id_cat'],
'name' => $row_board['cat_name'],
'is_collapsed' => isset($row_board['can_collapse']) && $row_board['can_collapse'] == 1 && $row_board['is_collapsed'] > 0,
'can_collapse' => isset($row_board['can_collapse']) && $row_board['can_collapse'] == 1,
'collapse_href' => isset($row_board['can_collapse']) ? $scripturl . '?action=collapse;c=' . $row_board['id_cat'] . ';sa=' . ($row_board['is_collapsed'] > 0 ? 'expand' : 'collapse;') . (isset($context['single_cats']) ? ';c_redirect=' . (is_array($_REQUEST['c']) ? implode(',', $_REQUEST['c']) : $_REQUEST['c']) : '') . '#c' . $row_board['id_cat'] : '',

'collapse_image' => isset($row_board['can_collapse']) ? '<img src="' . $settings['images_url'] . '/' . ($row_board['is_collapsed'] > 0 ? 'expand.gif" alt="+"' : 'collapse.gif" alt="-"') . ' border="0" />' : '',
'href' => $scripturl . '?' . (!empty($context['TPortal']) ? 'action=forum;' : '') . 'action=forum;c=' . $row_board['id_cat'],
'boards' => array(),
'new' => false
);
// Single Category Mod Edited This.
            $categories[$row_board['id_cat']]['link'] = '<a id="c' . $row_board['id_cat'] . '" href="' . $categories[$row_board['id_cat']]['href'] . '">' . $row_board['cat_name'] . '</a>';

            // Single Category Mod
            if (isset($context['single_cats']) && !is_array($context['category_selection']))
               $context['linktree'][] = array(
                  'url' => $scripturl . '?' . (!empty($context['TPortal']) ? 'action=forum;' : '') . 'action=forum;c=' . $row_board['id_cat'],
                  'name' => $row_board['cat_name']);
            else
            {
               if(!isset($temp))
                  $temp = array();
               $temp[] = $row_board['cat_name'];
            }
         }

flickernever

Using SMF 1.1.10 which is compatible I got this message:

QuoteThe package you are trying to download or install is either corrupt or not compatible with this version of SMF.

What can be wrong?

SleePy

This is due to a bug in SMF related to how it handles revisions after x.x.9.  Simply add this to the end of your package manager url: ;version_emulate=1.1.9
Jeremy D ~ Site Team / SMF Developer ~ GitHub Profile ~ Join us on IRC @ Libera.chat/#smf ~ Support the SMF Support team!

sektor

Hello

Will this mod work on 1.1.11?

Thanx

sektor

I tried installing the mod using 1.1.9 emulation, but got this error:

Execute Modification   C:\inetpub\wwwroot\public\\smf/Sources/BoardIndex.php   Test failed

SleePy

Do you have any other mods installed?
Can you list them?
Do you know if any of those modified that file?
Jeremy D ~ Site Team / SMF Developer ~ GitHub Profile ~ Join us on IRC @ Libera.chat/#smf ~ Support the SMF Support team!

sektor

Quote from: SleePy on January 15, 2010, 06:35:02 PM
Do you have any other mods installed?
Can you list them?
Do you know if any of those modified that file?

Yes i do:

Pretty URLs
Thank-O-Matic
Version Emulate Dropdown

Neverhurry

#92
I just installed but i have the same problem as scoops09.

Quote from: SleePy on December 09, 2009, 07:00:45 PM
Give this a try.  Install both mods.

Open BoardIndex.php and find:

// Get out of this mess.
redirectexit('c=' . $_REQUEST['c_redirect']);


Then replace that with:



// Get out of this mess.
redirectexit((!empty($context['TPortal']) || defined('PortaMx') ? 'action=forum;' : '') . 'c=' . $_REQUEST['c_redirect']);


Let me know if that works.  If it does I will work on fixing this with the rest of the code and update the mod.

Hi, SleePy! I I tried that, but it still does work. I am using smf2.0 rc2 with default theme, what should I do? thanks!

Quote from: scoops09 on December 10, 2009, 05:29:56 AM
Thanks to SunKing, this problem is solved! This code works on both Simple Portal and PortaMx! I'm not sure exactly what he did so I'm just pasting the entire block he tweaked. I knew this was going to be an awesome mod and boy was I right! This is perfect for people who have a ton of categories & topics - Thanks SleePy!

// Run through the categories and boards (or only boards)....
while ($row_board = $smcFunc['db_fetch_assoc']($result_boards))
{
if ($boardIndexOptions['include_categories'])
{
$ignoreThisBoard = in_array($row_board['id_board'], $user_info['ignoreboards']);
$row_board['is_read'] = !empty($row_board['is_read']) || $ignoreThisBoard ? '1' : '0';
// Haven't set this category yet.
if (empty($categories[$row_board['id_cat']]))
{
$categories[$row_board['id_cat']] = array(
'id' => $row_board['id_cat'],
'name' => $row_board['cat_name'],
'is_collapsed' => isset($row_board['can_collapse']) && $row_board['can_collapse'] == 1 && $row_board['is_collapsed'] > 0,
'can_collapse' => isset($row_board['can_collapse']) && $row_board['can_collapse'] == 1,
'collapse_href' => isset($row_board['can_collapse']) ? $scripturl . '?action=collapse;c=' . $row_board['id_cat'] . ';sa=' . ($row_board['is_collapsed'] > 0 ? 'expand' : 'collapse;') . (isset($context['single_cats']) ? ';c_redirect=' . (is_array($_REQUEST['c']) ? implode(',', $_REQUEST['c']) : $_REQUEST['c']) : '') . '#c' . $row_board['id_cat'] : '',

'collapse_image' => isset($row_board['can_collapse']) ? '<img src="' . $settings['images_url'] . '/' . ($row_board['is_collapsed'] > 0 ? 'expand.gif" alt="+"' : 'collapse.gif" alt="-"') . ' border="0" />' : '',
'href' => $scripturl . '?' . (!empty($context['TPortal']) ? 'action=forum;' : '') . 'action=forum;c=' . $row_board['id_cat'],
'boards' => array(),
'new' => false
);
// Single Category Mod Edited This.
            $categories[$row_board['id_cat']]['link'] = '<a id="c' . $row_board['id_cat'] . '" href="' . $categories[$row_board['id_cat']]['href'] . '">' . $row_board['cat_name'] . '</a>';

            // Single Category Mod
            if (isset($context['single_cats']) && !is_array($context['category_selection']))
               $context['linktree'][] = array(
                  'url' => $scripturl . '?' . (!empty($context['TPortal']) ? 'action=forum;' : '') . 'action=forum;c=' . $row_board['id_cat'],
                  'name' => $row_board['cat_name']);
            else
            {
               if(!isset($temp))
                  $temp = array();
               $temp[] = $row_board['cat_name'];
            }
         }


Hi, scoops09, where should i paste this code? thank you!
I am using SMF 2.0.1, curve themes.

maipgeut

I  have this problem,

1.     Executar Modificación     .Sources//BoardIndex.php     Prueba fallida
2.    Executar Modificación    .Sources//Recent.php    Prueba fallida

I try to install manually but i can't find this lines in recent.php:

'href' => $scripturl . '#' . $row['ID_CAT'],
'link' => '<a href="' . $scripturl . '#' . $row['ID_CAT'] . '">' . $row['cname'] . '</a>'


and in BoardIndex.php

'href' => $scripturl . '#' . $row_board['ID_CAT'],

I have installed the simple portal and i'm using smf 1.1.11

Please any help? I attach this files
Ingresa a forosdelvago.com

sevamaster

Quote from: bjraines on May 18, 2009, 07:54:25 PM
great mod, is there a way to get it to work with Pretty URLs?

or at the very least have the title of the category pulled into the page title of each category page?

I agree. Great mod!
and i want to repeat this question.

Is there a way to get it to work with Pretty URLs?

Arantor

Since that requires some work on Pretty URLs' part rather than this mod, you'd best ask them.

Joker™

first of all the mod is awesome.

i've a little request that how can i disappear the whole category from main board , i.e category is not visible on main board but still accessible if we use the link of category using this mod.

Like
www.mysite.com/index.php?c=1  (this link is still working , but this category is hidden on main board index)

Github Profile
Android apps
Medium

How to enable Post Moderation

"For the wise man looks into space and he knows there is no limited dimensions." - Laozi

All support seeking PM's get microwaved

Joker™

Github Profile
Android apps
Medium

How to enable Post Moderation

"For the wise man looks into space and he knows there is no limited dimensions." - Laozi

All support seeking PM's get microwaved

Joker™

Github Profile
Android apps
Medium

How to enable Post Moderation

"For the wise man looks into space and he knows there is no limited dimensions." - Laozi

All support seeking PM's get microwaved

maipgeut

anyone can help me? please sleepy
Ingresa a forosdelvago.com

Advertisement: