Congratulations to the Winner Linkernel.com of the
Dir.vc Web Directory Competition!
RSS Feed Directory Forums Blog Articles Submit Site Popular Sites Contact Us
Web Directory » Blog
|__ phpLD – Show Category Path while approving sites

phpLD – Show Category Path while approving sites

  - August 11th, 2007 by Web Directory | Posted in phpLD Hacks & tweeks!   8 Comments »
Email this  Email  |   Print This Post Print This Post     

UPDATE: the mod has been upgraded to work with phpLd 4.0.0, please down here

Hello,
making my last mod and upgrading it to 3.x, i found loads of times various category names being repeating, most common being “Blog”!

One would find Blog as a root category, and yet you have Art Weblogs under Arts, Blog Hosting under Hosting,….etc

Now in phpLD approve section, all i have is which category is the site submitted to!

I thought it would be better if I were to know the whole path in the admin section so i know exactly where the submission has been made

heres the hack!
Works on phpLD 3.1 and phpLD 3.2,

Open /admin/dirdb_admin.php and find:

function getFullLinkInfo($id=0)

in that function find!

     $sql = "SELECT {$tables['link']['name']}.*, ".$db->IfNull("{$tables['category']['name']}.TITLE", "'Top'")." AS `CATEGORY` FROM `{$tables['link']['name']}` LEFT JOIN `{$tables['category']['name']}` ON ({$tables['link']['name']}.CATEGORY_ID = {$tables['category']['name']}.ID) WHERE {$tables['link']['name']}.ID = ".$db->qstr($id)." LIMIT 1";

Replace this line to :

     $sql = "SELECT {$tables['link']['name']}.*, ".$db->IfNull("{$tables['category']['name']}.TITLE", "'Top'")." AS `CATEGORY`, ".$db->IfNull("{$tables['category']['name']}.CACHE_URL", "'#'")." AS `CACHE_URL` FROM `{$tables['link']['name']}` LEFT JOIN `{$tables['category']['name']}` ON ({$tables['link']['name']}.CATEGORY_ID = {$tables['category']['name']}.ID) WHERE {$tables['link']['name']}.ID = ".$db->qstr($id)." LIMIT 1";

2. Now open up /templates/Core/admin/link_details.tpl and Find:

      <tr class="{cycle values="odd,even"}"><td class="label">{l}Category{/l}:</td><td class="smallDesc">{if $row.CATEGORY_ID eq '-1'}<span class="orphan">{l}Orphan{/l}</span>{else}{$linkInfo.CATEGORY|escape|trim}({$linkInfo.CATEGORY_ID}{/if}</td></tr>

Replace this by:

      <tr class="{cycle values="odd,even"}"><td class="label">{l}Category{/l}:</td><td class="smallDesc">{if $row.CATEGORY_ID eq '-1'}<span class="orphan">{l}Orphan{/l}</span>{else}{$linkInfo.CATEGORY|escape|trim}({$linkInfo.CATEGORY_ID})<br />[{$linkInfo.CACHE_URL|escape|trim}]{/if}</td></tr>

Older builds of the 3.2 version, or 3.1 may have a different line for this, all that has been added to the category line is:

<br />[{$linkInfo.CACHE_URL|escape|trim}]

Done!

Here’s a Screenshot :

phpLD - Show Category Path while approving sites

Hope this helps someone!
Regards,
M.

8 Responses to “phpLD – Show Category Path while approving sites”

  1. There is some problem with your code for dirbd_admin.php It is not even recognised as a php statement and gives a expected { error.

  2. msolution says:

    I think the issue would be character encoding,
    while what you copy from here would be UTF-8,
    and your text editor may be copy-pasting the same thing,

    try replacing all quotes and single quotes manually to solve the issue,

    Regards,
    M.

  3. I don`t see any info when i edit this file “dirbd_admin.php”

    Image:- http://img408.imageshack.us/img408/6861/blankkv5.jpg

    Please help.

  4. DeepLD says:

    look great, i really like it gonna used it.

    Thank You.

  5. This code works perfectly with phpLD V 3.3. I have installed it on my directory.

  6. Dogs says:

    I think the issue would be character encoding,
    while what you copy from here would be UTF-8,

  7. Radi says:

    Is there a way to add this mod to version 2.2 (or 2.12) of PHPLD ?

  8. MSolution says:

    no this mod will not work on 2.x

Leave a Reply

Captcha
Enter the letters you see above.



Entries (RSS) and Comments (RSS) Blog – Dir.vc :: Web Directory is proudly powered by WordPress - Site By : M-Solutions India