Guest Posted February 27, 2020 Posted February 27, 2020 I'm hoping for help to find where I need to interject code to redirect a category link to a password protected page. In my index.php file, I have examples of how to do that on the main catalog view, but I'm at a loss as to how to add it to the subcategory. I believe the line of code that I need to interject is the following. <td class="pageHeading2" align="center">Dual Logo Stationery<br><Br><a class="hvr-grow" href="https://REDACTED/restricted-access2.php"><img src="https://REDACTED/images/Dual-Logo.png" width="325px"></img></a></td> The source code for the above works perfectly if added to the main category page, but now I just need to get it moved to cPath=8 Any help is appreciated. index.php
♥ecartz Posted February 27, 2020 Posted February 27, 2020 It might be easier to do this at the mod_rewrite level. Or to make the password protection work in a different fashion. But the line for which you are looking is 316. echo ' <td align="center" class="smallText2" width="' . $width . '" valign="top"><a href="' . tep_href_link(FILENAME_DEFAULT, $cPath_new) . '">' . $categories['categories_name'], '','' . '</a><br><BR><a class="hvr-grow" href="' . tep_href_link(FILENAME_DEFAULT, $cPath_new) . '">' . tep_image(DIR_WS_IMAGES . $categories['categories_image'], 0,450) . '</a></td>' . "\n"; Presumably you want something like if ('8' == $cPath) { // revised code here } else { echo ' <td align="center" class="smallText2" width="' . $width . '" valign="top"><a href="' . tep_href_link(FILENAME_DEFAULT, $cPath_new) . '">' . $categories['categories_name'], '','' . '</a><br><BR><a class="hvr-grow" href="' . tep_href_link(FILENAME_DEFAULT, $cPath_new) . '">' . tep_image(DIR_WS_IMAGES . $categories['categories_image'], 0,450) . '</a></td>' . "\n"; } Always back up before making changes.
Guest Posted February 27, 2020 Posted February 27, 2020 8 minutes ago, ecartz said: It might be easier to do this at the mod_rewrite level. Or to make the password protection work in a different fashion. But the line for which you are looking is 316. echo ' <td align="center" class="smallText2" width="' . $width . '" valign="top"><a href="' . tep_href_link(FILENAME_DEFAULT, $cPath_new) . '">' . $categories['categories_name'], '','' . '</a><br><BR><a class="hvr-grow" href="' . tep_href_link(FILENAME_DEFAULT, $cPath_new) . '">' . tep_image(DIR_WS_IMAGES . $categories['categories_image'], 0,450) . '</a></td>' . "\n"; Presumably you want something like if ('8' == $cPath) { // revised code here } else { echo ' <td align="center" class="smallText2" width="' . $width . '" valign="top"><a href="' . tep_href_link(FILENAME_DEFAULT, $cPath_new) . '">' . $categories['categories_name'], '','' . '</a><br><BR><a class="hvr-grow" href="' . tep_href_link(FILENAME_DEFAULT, $cPath_new) . '">' . tep_image(DIR_WS_IMAGES . $categories['categories_image'], 0,450) . '</a></td>' . "\n"; } Thank you! I'm going to be out of the office for the rest of the day, but I'm going to give this a try first thing tomorrow morning!
Recommended Posts
Archived
This topic is now archived and is closed to further replies.