how to change "all" on mydomain.com/all

Register an Account
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old 08-26-2009, 02:10 PM
Casual Pligger
Pligg Version: 1.2.0
 
Join Date: Jul 2009
Posts: 48
Hi,
Can someone please help me find the way to change the "all" category name?

there is a category named 'all' which is not available in my Category Management area. I can see mydomain.com/all

I want to either rename it or remove it.
Reply With Quote
  #2 (permalink)  
Old 08-26-2009, 02:22 PM
Yankidank's Avatar
Pligg Founder/Coder/Designer
Pligg Version: SVN
Pligg Template: Wistie
 
Join Date: Dec 2005
Location: Ocala, FL
Posts: 4,934
Send a message via AIM to Yankidank
You can't rename it, it displays the same results as it would without applying the /all to the link. You might just want to add a rewrite rule to your .htaccess to redirect /all to your homepage. The /all link shouldn't appear anywhere on your website either, so this really shouldn't be a big deal.

The Twitter Module for Pligg CMS!
Register, Login, and Submit Stories with Twitter. An absolute MUST HAVE for all Pligg sites!
Reply With Quote
  #3 (permalink)  
Old 08-26-2009, 03:25 PM
Casual Pligger
Pligg Version: 1.2.0
 
Join Date: Jul 2009
Posts: 48
Quote:
Originally Posted by Yankidank View Post
You can't rename it, it displays the same results as it would without applying the /all to the link. You might just want to add a rewrite rule to your .htaccess to redirect /all to your homepage. The /all link shouldn't appear anywhere on your website either, so this really shouldn't be a big deal.
I am using a code to display categories and sub-categories they way http://www.indianbytes.com/ is displaying, so for logged in users, there is no all category, but normal visitors who are not logged in, "all" will appear as the first category which I don't want.

Here is the code I am using:

Code:
<div id="topbar">
	{if $pagename eq 'published' || $pagename eq 'upcoming'}
		{******Get the parent category******}
			{assign var=requested_cat value=$request_category}

			{* if story page - set the story's category to this *}
			{if $pagename eq 'story'}

				{assign var=requested_cat value='sub'}
			{/if}

			{assign var=mainCatStr value=''}
			{assign var=parentCat value=-1}
			{section name=thecat loop=$cat_array}
				
				{if $cat_array[thecat].safename eq $requested_cat}
					{if $cat_array[thecat].parent neq 0}
						
						{assign var=parentCat value=$cat_array[thecat].parent}
						{assign var=mainCatStr value=$cat_array[$parentCat].safename}
					{else}
						
						{assign var=parentCat value=$cat_array[thecat].auto_id}
						{assign var=mainCatStr value=$cat_array[thecat].safename}
					{/if}
				{/if}
			{/section}
			{********* Displaying the Main categories *******************}
			
			{section name=thecat loop=$cat_array}
				
				{if $cat_array[thecat].parent eq 0}
					
					{if $cat_array[thecat].safename eq $requested_cat || $cat_array[thecat].auto_id eq $parentCat}
						{if $pagename eq "published"}
							<a href="{$URL_maincategory, $cat_array[thecat].safename}" class="active"><span>{$cat_array[thecat].name}</span></a>
						{else}
							<a href="{$URL_queuedcategory, $cat_array[thecat].safename}" class="active"><span>{$cat_array[thecat].name}</span></a>
						{/if}
					{elseif $requested_cat eq "" && $cat_array[thecat].auto_id eq 0}
						{if $pagename eq "published"}
							<a href="{$URL_maincategory, $cat_array[thecat].safename}"><span>{$cat_array[thecat].name}</span></a>
						{else}
							<a href="{$URL_queuedcategory, $cat_array[thecat].safename}"><span>{$cat_array[thecat].name}</span></a>
						{/if}
					{else}
						{if $pagename eq "published"}
							<a href="{$URL_maincategory, $cat_array[thecat].safename}"><span>{$cat_array[thecat].name}</span></a>
						{else}
							<a href="{$URL_queuedcategory, $cat_array[thecat].safename}"><span>{$cat_array[thecat].name}</span></a>
						{/if}
					{/if}
				{/if}
			{/section}
			
			</div>

			
			{********* Displaying the Sub categories *******************}
			
			{if $parentCat gt 0} 
				<div id="middlebar">
				{*{if $requested_cat eq $mainCatStr}
					{if $pagename eq "published"}
						<a href="{$URL_maincategory, $cat_array[thecat].safename}">{$cat_array[thecat].name}</a>
					{else}
						<a href="{$URL_queuedcategory, $cat_array[thecat].safename}">{$cat_array[thecat].name}</a>
					{/if}

				
				{else}

					{if $pagename eq "published"}
						3<a href="{$URL_maincategory, $cat_array[thecat].safename}"  class="subactive"><span>{$cat_array[thecat].name}</span></a>
					{else}
						4<a href="{$URL_queuedcategory, $cat_array[thecat].safename}"  class="subactive"><span>{$cat_array[thecat].name}</span></a>
					{/if}
				
				{/if}*}
				{section name=thecat loop=$cat_array}
					{if $cat_array[thecat].parent eq $parentCat}
						{if $cat_array[thecat].safename eq $requested_cat}
							{if $pagename eq "published"}
								<a href="{$URL_maincategory, $cat_array[thecat].safename}"  class="subactive"><span>{$cat_array[thecat].name}</span></a>
							{else}
								<a href="{$URL_queuedcategory, $cat_array[thecat].safename}"  class="subactive"><span>{$cat_array[thecat].name}</span></a>
							{/if}

						{else}
							{if $pagename eq "published"}
								<a href="{$URL_maincategory, $cat_array[thecat].safename}"><span>{$cat_array[thecat].name}</span></a>
							{else}
								<a href="{$URL_queuedcategory, $cat_array[thecat].safename}"><span>{$cat_array[thecat].name}</span></a>
							{/if}

						{/if}
					{/if}
				{/section}
				</div>
			{/if}



	{elseif $pagename neq 'submit'}
	{********* Displaying the Main categories *******************}
	
	{section name=thecat loop=$cat_array}
	
		{if $cat_array[thecat].parent eq 0}
			<a href="{$URL_maincategory, $cat_array[thecat].safename}"><span>{$cat_array[thecat].name}</span></a>
		{/if}
	{/section}
	
	{else}
		<div id="border" style="border-bottom:6px solid #fff;padding:12px"></div>
	{/if}
	{*
   
	   <a href='{$my_base_url}{$my_pligg_base}{$link_category}' title="All">All {$link_category}</a>
		{section name=thecat loop=$cat_array start=1}

		<a href="{$URL_maincategory, $cat_array[thecat].safename}">{$cat_array[thecat].name}</a>
		{/section}
	*}
	
	
	
</div>
Can you please tell me what to do to avoid displaying "all" category?
Reply With Quote
  #4 (permalink)  
Old 08-27-2009, 01:12 AM
New Pligger
Pligg Version: 1.01
 
Join Date: Aug 2009
Posts: 5
hey af 40 did you get it work?
Reply With Quote
  #5 (permalink)  
Old 08-27-2009, 07:12 AM
Casual Pligger
Pligg Version: 1.2.0
 
Join Date: Jul 2009
Posts: 48
Quote:
Originally Posted by labradorcaretraining View Post
hey af 40 did you get it work?
Yes, I fixed this issue by changing the following code:

Code:
Change 

{section name=thecat loop=$cat_array}

to

{section name=thecat loop=$cat_array start=$start}
It works perfect now.
Reply With Quote
  #6 (permalink)  
Old 09-09-2009, 11:09 AM
New Pligger
 
Join Date: Aug 2007
Posts: 24
Quote:
Originally Posted by af_40 View Post
Code:
<div id="topbar">
	{if $pagename eq 'published' || $pagename eq 'upcoming'}
		{******Get the parent category******}
			{assign var=requested_cat value=$request_category}

			{* if story page - set the story's category to this *}
			{if $pagename eq 'story'}

				{assign var=requested_cat value='sub'}
			{/if}

			{assign var=mainCatStr value=''}
			{assign var=parentCat value=-1}
			{section name=thecat loop=$cat_array}
				
				{if $cat_array[thecat].safename eq $requested_cat}
					{if $cat_array[thecat].parent neq 0}
						
						{assign var=parentCat value=$cat_array[thecat].parent}
						{assign var=mainCatStr value=$cat_array[$parentCat].safename}
					{else}
						
						{assign var=parentCat value=$cat_array[thecat].auto_id}
						{assign var=mainCatStr value=$cat_array[thecat].safename}
					{/if}
				{/if}
			{/section}
			{********* Displaying the Main categories *******************}
			
			{section name=thecat loop=$cat_array}
				
				{if $cat_array[thecat].parent eq 0}
					
					{if $cat_array[thecat].safename eq $requested_cat || $cat_array[thecat].auto_id eq $parentCat}
						{if $pagename eq "published"}
							<a href="{$URL_maincategory, $cat_array[thecat].safename}" class="active"><span>{$cat_array[thecat].name}</span></a>
						{else}
							<a href="{$URL_queuedcategory, $cat_array[thecat].safename}" class="active"><span>{$cat_array[thecat].name}</span></a>
						{/if}
					{elseif $requested_cat eq "" && $cat_array[thecat].auto_id eq 0}
						{if $pagename eq "published"}
							<a href="{$URL_maincategory, $cat_array[thecat].safename}"><span>{$cat_array[thecat].name}</span></a>
						{else}
							<a href="{$URL_queuedcategory, $cat_array[thecat].safename}"><span>{$cat_array[thecat].name}</span></a>
						{/if}
					{else}
						{if $pagename eq "published"}
							<a href="{$URL_maincategory, $cat_array[thecat].safename}"><span>{$cat_array[thecat].name}</span></a>
						{else}
							<a href="{$URL_queuedcategory, $cat_array[thecat].safename}"><span>{$cat_array[thecat].name}</span></a>
						{/if}
					{/if}
				{/if}
			{/section}
			
			</div>

			
			{********* Displaying the Sub categories *******************}
			
			{if $parentCat gt 0} 
				<div id="middlebar">
				{*{if $requested_cat eq $mainCatStr}
					{if $pagename eq "published"}
						<a href="{$URL_maincategory, $cat_array[thecat].safename}">{$cat_array[thecat].name}</a>
					{else}
						<a href="{$URL_queuedcategory, $cat_array[thecat].safename}">{$cat_array[thecat].name}</a>
					{/if}

				
				{else}

					{if $pagename eq "published"}
						3<a href="{$URL_maincategory, $cat_array[thecat].safename}"  class="subactive"><span>{$cat_array[thecat].name}</span></a>
					{else}
						4<a href="{$URL_queuedcategory, $cat_array[thecat].safename}"  class="subactive"><span>{$cat_array[thecat].name}</span></a>
					{/if}
				
				{/if}*}
				{section name=thecat loop=$cat_array}
					{if $cat_array[thecat].parent eq $parentCat}
						{if $cat_array[thecat].safename eq $requested_cat}
							{if $pagename eq "published"}
								<a href="{$URL_maincategory, $cat_array[thecat].safename}"  class="subactive"><span>{$cat_array[thecat].name}</span></a>
							{else}
								<a href="{$URL_queuedcategory, $cat_array[thecat].safename}"  class="subactive"><span>{$cat_array[thecat].name}</span></a>
							{/if}

						{else}
							{if $pagename eq "published"}
								<a href="{$URL_maincategory, $cat_array[thecat].safename}"><span>{$cat_array[thecat].name}</span></a>
							{else}
								<a href="{$URL_queuedcategory, $cat_array[thecat].safename}"><span>{$cat_array[thecat].name}</span></a>
							{/if}

						{/if}
					{/if}
				{/section}
				</div>
			{/if}



	{elseif $pagename neq 'submit'}
	{********* Displaying the Main categories *******************}
	
	{section name=thecat loop=$cat_array}
	
		{if $cat_array[thecat].parent eq 0}
			<a href="{$URL_maincategory, $cat_array[thecat].safename}"><span>{$cat_array[thecat].name}</span></a>
		{/if}
	{/section}
	
	{else}
		<div id="border" style="border-bottom:6px solid #fff;padding:12px"></div>
	{/if}
	{*
   
	   <a href='{$my_base_url}{$my_pligg_base}{$link_category}' title="All">All {$link_category}</a>
		{section name=thecat loop=$cat_array start=1}

		<a href="{$URL_maincategory, $cat_array[thecat].safename}">{$cat_array[thecat].name}</a>
		{/section}
	*}
	
	
	
</div>

hi, if you know can you tell how to display subcategory under main category title in this code instead at bottom of all main categories. thanks
Reply With Quote
  #7 (permalink)  
Old 09-09-2009, 11:50 AM
Casual Pligger
Pligg Version: 1.2.0
 
Join Date: Jul 2009
Posts: 48
Quote:
hi, if you know can you tell how to display subcategory under main category title in this code instead at bottom of all main categories. thanks
The above code already help you display sub-categories of any category under it while it is selected.
Reply With Quote
  #8 (permalink)  
Old 09-09-2009, 12:08 PM
New Pligger
 
Join Date: Aug 2007
Posts: 24
hi, yes it does display subcategory in parent category.

But it displays at bottom of all other main categories.

like -

main cat 1
main cat 2
main cat 3
subcat 1 for main cat 1
subcat 2 for main cat 1

is there way to do

main cat 1
subcat 1 for main cat 1
subcat 2 for main cat 1
main cat 2
mian cat 3


Thank you.
Reply With Quote
Reply

Tags
category

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to make / change a template in Pligg Beta 7 jimbeam Questions and Comments 2 09-15-2009 10:35 PM
how to modify the htaccess to change url terrybarna Questions and Comments 2 03-05-2009 03:19 AM
Can't change password rssfeeds Questions and Comments 1 08-02-2008 07:14 AM
HELP: Continuos parse errors when trying to change the template code juanmartinbravo Questions and Comments 7 01-26-2008 06:03 AM
Change "tell me about pligg" and more fastcart Questions and Comments 1 09-07-2006 04:24 PM


Pligg Modules and Pligg Templates from Pligg Pro Find support on the Pligg CMS Forum - 24 hours a day! Make a donation to support Pligg CMS development