Advertisement:

Author Topic: View Single Category  (Read 80487 times)

Offline SleePy

  • Let there be light!
  • Site Team Lead
  • SMF Master
  • *
  • Posts: 30,506
  • Gender: Male
  • Thats his happy face.
    • jdarwood007 on GitHub
    • @jdarwood on Twitter
    • SleePy Code - My personal site
Re: View Single Category
« Reply #80 on: November 21, 2009, 07:48:15 PM »
As said in the other topic, please try again :)
Jeremy D — Site Team / SMF Developer
Support the SMF Support team!
Profiles:
GitHub

Offline scoops09

  • Jr. Member
  • **
  • Posts: 116
  • Gender: Male
  • Damn, that's one cool chimp!
    • Cool Chimp
Re: View Single Category
« Reply #81 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.

Offline Hoodie

  • Jr. Member
  • **
  • Posts: 158
  • Gender: Male
Re: View Single Category
« Reply #82 on: December 08, 2009, 09:55:26 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..

Offline scoops09

  • Jr. Member
  • **
  • Posts: 116
  • Gender: Male
  • Damn, that's one cool chimp!
    • Cool Chimp
Re: View Single Category
« Reply #83 on: December 09, 2009, 12:41:21 AM »
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!

Offline SleePy

  • Let there be light!
  • Site Team Lead
  • SMF Master
  • *
  • Posts: 30,506
  • Gender: Male
  • Thats his happy face.
    • jdarwood007 on GitHub
    • @jdarwood on Twitter
    • SleePy Code - My personal site
Re: View Single Category
« Reply #84 on: December 09, 2009, 07:00:45 PM »
Give this a try.  Install both mods.

Open BoardIndex.php and find:
Code: [Select]
// Get out of this mess.
redirectexit('c=' . $_REQUEST['c_redirect']);

Then replace that with:
Code: [Select]
// 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
Support the SMF Support team!
Profiles:
GitHub

Offline scoops09

  • Jr. Member
  • **
  • Posts: 116
  • Gender: Male
  • Damn, that's one cool chimp!
    • Cool Chimp
Re: View Single Category
« Reply #85 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!

Code: [Select]
// 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'];
            }
         }

Offline flickernever

  • Semi-Newbie
  • *
  • Posts: 69
Re: View Single Category
« Reply #86 on: January 10, 2010, 09:27:46 AM »
Using SMF 1.1.10 which is compatible I got this message:

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

What can be wrong?

Offline SleePy

  • Let there be light!
  • Site Team Lead
  • SMF Master
  • *
  • Posts: 30,506
  • Gender: Male
  • Thats his happy face.
    • jdarwood007 on GitHub
    • @jdarwood on Twitter
    • SleePy Code - My personal site
Re: View Single Category
« Reply #87 on: January 11, 2010, 06:46:36 PM »
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
Support the SMF Support team!
Profiles:
GitHub

Offline sektor

  • Jr. Member
  • **
  • Posts: 341
Re: View Single Category
« Reply #88 on: January 12, 2010, 06:40:37 PM »
Hello

Will this mod work on 1.1.11?

Thanx

Offline sektor

  • Jr. Member
  • **
  • Posts: 341
Re: View Single Category
« Reply #89 on: January 13, 2010, 07:21:59 PM »
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

Offline SleePy

  • Let there be light!
  • Site Team Lead
  • SMF Master
  • *
  • Posts: 30,506
  • Gender: Male
  • Thats his happy face.
    • jdarwood007 on GitHub
    • @jdarwood on Twitter
    • SleePy Code - My personal site
Re: View Single Category
« Reply #90 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?
Jeremy D — Site Team / SMF Developer
Support the SMF Support team!
Profiles:
GitHub

Offline sektor

  • Jr. Member
  • **
  • Posts: 341
Re: View Single Category
« Reply #91 on: January 15, 2010, 07:35:46 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

Offline Neverhurry

  • Sophist Member
  • *****
  • Posts: 1,019
  • Life is compromise.
    • We love Slovakia!
Re: View Single Category
« Reply #92 on: January 23, 2010, 04:00:22 PM »
I just installed but i have the same problem as scoops09.

Give this a try.  Install both mods.

Open BoardIndex.php and find:
Code: [Select]
// Get out of this mess.
redirectexit('c=' . $_REQUEST['c_redirect']);

Then replace that with:
Code: [Select]


// 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!

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!

Code: [Select]
// 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!
« Last Edit: January 23, 2010, 04:12:35 PM by neverhurry »
I am using SMF 2.0.1, curve themes.

Offline maipgeut

  • Semi-Newbie
  • *
  • Posts: 44
  • Gender: Male
    • Foros del Vago
Re: View Single Category
« Reply #93 on: April 18, 2010, 05:50:33 AM »
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:

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

and in BoardIndex.php

Code: [Select]
'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

Offline sevamaster

  • Semi-Newbie
  • *
  • Posts: 48
  • Gender: Male
    • Free Seo Tools
Re: View Single Category
« Reply #94 on: April 20, 2010, 06:36:45 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?

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 71,980
    • StoryBB/StoryBB on GitHub
Re: View Single Category
« Reply #95 on: April 20, 2010, 06:39:07 PM »
Since that requires some work on Pretty URLs' part rather than this mod, you'd best ask them.
Don’t try to tell me that some power can corrupt a person. You haven’t had enough to know what it’s like.

No good deed goes unpunished / No act of charity goes unresented.

Offline Joker™

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 5,914
  • Gender: Male
    • siddhartha-gupta on GitHub
Re: View Single Category
« Reply #96 on: June 21, 2010, 12:45:21 PM »
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

Offline Joker™

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 5,914
  • Gender: Male
    • siddhartha-gupta on GitHub
Re: View Single Category
« Reply #97 on: June 23, 2010, 09:15:24 AM »
bump*
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

Offline Joker™

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 5,914
  • Gender: Male
    • siddhartha-gupta on GitHub
Re: View Single Category
« Reply #98 on: July 01, 2010, 05:57:17 AM »
bump*******
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

Offline maipgeut

  • Semi-Newbie
  • *
  • Posts: 44
  • Gender: Male
    • Foros del Vago
Re: View Single Category
« Reply #99 on: July 07, 2010, 03:27:15 AM »
anyone can help me? please sleepy
Ingresa a forosdelvago.com