Return to iWEBTOOL

Go Back   iWEBTOOL Talk > The Web and your Website > Programming
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
 
Welcome to iWEBTOOL Talk, where you talk about webmaster-related stuff.
 
Discuss topics which interest you.
With over thousands of threads (topics), we're sure you'll find something that'll interest you.
Ask for help whenever you need it.
We have thousands of members who are available to help you if you need it.
It's absolutely FREE!

 1  Register           2  Browse the board           3  Discuss whatever may interest you!
 


Closed Thread
 
Thread Tools Search this Thread Display Modes
Old 10-06-2007, 09:08 PM   #1
swiftmed
Senior Member
 
swiftmed's Avatar
 
Join Date: Feb 2007
Location: Plymouth, United Kingdom
Posts: 342
swiftmed will become famous soon enough
Send a message via MSN to swiftmed
Default How can i remove the link from my category titles?

Hey Guys,

Currently the titles of my categories in my coloum_left links to that particular category. on this occasion i dont want the category title to link to anything, but instead just be there as a category name. can anybody make sense of the code below and posibly edit it for me so that my category titles do not link to anything.

so you understand what i mean by category titles please see this page: http://www.strathfieldbrookvale.com.au/ - in the left menu, i do not want the words "Menu" and "Electronics" to link to anything.

Quote:
<? // ---- CATEGORIES 2 LEVELS OPEN

function tep_show_category($counter) {
global $tree, $categories_string, $cPath_array;

if(!$tree[$counter]['level']){

$categories_string .= $categories_string ? '<tr><td height=9></td></tr>' : '';

$categories_string .= '<tr><td class=ch3><a class=ch3 href=';

if ($tree[$counter]['parent'] == 0) {
$cPath_new = 'cPath=' . $counter;
} else {
$cPath_new = 'cPath=' . $tree[$counter]['path'];
}
$categories_string .= tep_href_link('index.php', $cPath_new) . '>';
// display categry name
$categories_string .= $tree[$counter]['name'];
$categories_string .= '</a></td></tr>';
$categories_string .= '<tr><td height=16></td></tr>';

}else{ // SUBCATEGORY

$categories_string .= '<tr><td background=images/m09.gif height=1></td></tr><tr><td height=1></td></tr>';

for($i=0;$i<$tree[$counter]['le vel'];$i++)
$categories_string .= '&nbsp;&nbsp;&nbsp;';

$categories_string .= '<tr><td>&nbsp;<img src=images/m08.gif width=4 height=5 align=absmiddle> &nbsp; <a class=ml2 href=';
if ($tree[$counter]['parent'] == 0) {
$cPath_new = 'cPath=' . $counter;
} else {
$cPath_new = 'cPath=' . $tree[$counter]['path'];
}
$categories_string .= tep_href_link('index.php', $cPath_new) . '>';
// display category name
$categories_string .= $tree[$counter]['name'];
$categories_string .= '</a></td></tr><tr><td height=1></td></tr>';
}

if ($tree[$counter]['next_id'] != false) {
tep_show_category($tree[$counter]['next_id']);
}
}



define(TABLE_CATEGORIES, "categories");
define(TABLE_CATEGORIES_DESCRIPTION, "categories_description");
$categories_string = '';
$tree = array();

$categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '0' and c.categories_id = cd.categories_id and cd.language_id='" . (int)$languages_id ."' order by sort_order, cd.categories_name");
while ($categories = tep_db_fetch_array($categories_query)) {
$tree[$categories['categories_id']] = array('name' => $categories['categories_name'],
'parent' => $categories['parent_id'],
'level' => 0,
'path' => $categories['categories_id'],
'next_id' => false);

if (isset($parent_id)) {
$tree[$parent_id]['next_id'] = $categories['categories_id'];
}

$parent_id = $categories['categories_id'];

if (!isset($first_element)) {
$first_element = $categories['categories_id'];
}

}


$categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '0' and c.categories_id = cd.categories_id and cd.language_id='" . (int)$languages_id ."' order by sort_order, cd.categories_name");
while ($categories = tep_db_fetch_array($categories_query)) {
$cPath_array2 = Array();
$new_path = '';
$cPath_array2[] = $categories['categories_id'];
while (list($key, $value) = each($cPath_array2)) {
unset($parent_id);
unset($first_id);
$categories_query2 = tep_db_query("select c.categories_id, cd.categories_name, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '" . (int)$value . "' and c.categories_id = cd.categories_id and cd.language_id='" . (int)$languages_id ."' order by sort_order, cd.categories_name");
if (tep_db_num_rows($categories_query2)) {
$new_path .= $value;
while ($row = tep_db_fetch_array($categories_query2)) {
$tree[$row['categories_id']] = array('name' => $row['categories_name'],
'parent' => $row['parent_id'],
'level' => $key+1,
'path' => $new_path . '_' . $row['categories_id'],
'next_id' => false);

if (isset($parent_id)) {
$tree[$parent_id]['next_id'] = $row['categories_id'];
}

$parent_id = $row['categories_id'];

if (!isset($first_id)) {
$first_id = $row['categories_id'];
}

$last_id = $row['categories_id'];
}
$tree[$last_id]['next_id'] = $tree[$value]['next_id'];
$tree[$value]['next_id'] = $first_id;
$new_path .= '_';
} else {
break;
}
}

}

//------------------------

$categories_string .= '';
tep_show_category($first_element);
$categories_string .= '';

echo $categories_string;
?>

Your help would be very much appreciated. thanks guys & gals.
__________________
Kind Regards,
Andy MacDonald
SEO & Marketing Tips for Webmasters | Logo Design
swiftmed is offline  
 
This is an Ad Revenue Sharing forum Place your advert here
SEO Checklist
Get yourself better ranking with
our "Do-it-Yourself" SEO Checklist.
Click Here
Old 10-09-2007, 12:07 AM   #2
thegeek
Junior Member
 
thegeek's Avatar
 
Join Date: Sep 2007
Posts: 54
thegeek will become famous soon enough
Default Re: How can i remove the link from my category titles?

PHP Code:
$categories_string .= '<tr><td class=ch3[b]><a class=ch3 href=';

if (
$tree[$counter]['parent'] == 0) {
$cPath_new 'cPath=' $counter;
} else {
$cPath_new 'cPath=' $tree[$counter]['path'];
}
$categories_string .= tep_href_link('index.php'$cPath_new) . '>';
// display categry name
$categories_string .= $tree[$counter]['name'];
$categories_string .= '</a>[/b]</td></tr>';
$categories_string .= '<tr><td height=16></td></tr> 

if you ANCHOR tags between <a class=ch3 TO </a> the category will not produce a link. The exact syntax may not be correct, but the <a> </a> is causing your top level to link.

Here's my attempt at PHP below.

PHP Code:
$categories_string .= '<tr><td class=ch3>';

if (
$tree[$counter]['parent'] == 0) {
$categories_string .= $tree[$counter]['name'];
$categories_string .= '</td></tr>';
$categories_string .= '<tr><td height=16></td></tr> 
__________________
thegeek
http://www.fishinggeek.net
thegeek is offline  
Old 10-10-2007, 01:40 AM   #3
swiftmed
Senior Member
 
swiftmed's Avatar
 
Join Date: Feb 2007
Location: Plymouth, United Kingdom
Posts: 342
swiftmed will become famous soon enough
Send a message via MSN to swiftmed
Default Re: How can i remove the link from my category titles?

Hello mate,

that is great, thanks very much for that. ive left green reps for you. thanks for your help
__________________
Kind Regards,
Andy MacDonald
SEO & Marketing Tips for Webmasters | Logo Design
swiftmed is offline  
 
This is an Ad Revenue Sharing forum Place your advert here
Webmaster Tools Webmaster Tools Click Here
Closed Thread

(Threads which have no activity for more than 30 days are automatically closed.)



Quick Reply
Message:

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
2-way oy 3-way link exchange - All category RCCarsRCTrucks Link Exchange 0 06-30-2007 03:33 AM
Can anyone explain multiple titles to me. clangallacher General Talk 7 05-02-2007 05:18 AM
How to remove the daily limit hhheng Discuss iWEBTOOL 1 12-06-2006 02:00 PM


All times are GMT. The time now is 06:28 PM.


Powered by vBulletin v3.6.7 © 2008, Jelsoft Enterprises Ltd. SEO by vBSEO © 2006, Crawlability, Inc.