View Full Version : manage-links > page count error
Bryan Ex
12-21-2006, 05:01 PM
I thought this had been addressed but perhaps it was only for the front end. I currently have Pro 1.2 with some of the patches installed (not all of them due to custom coding). In the admin panel > manage links the number of pages indexed is being calculated on the total number of links in the directory including cross links which leaves many blank pages at the end. For example, I should have 14 pages of links but there are over twenty listed with the last 10 or more all blank pages because the total links includes cross links. To get to my first link added I have to click on page 5 and then go back a page at a time until links run out. The query for the manage links pagination needs a "where not a cross link" added somehow.
Dave Baker
12-21-2006, 06:16 PM
Hello Bryan,
This question is interesting and disputable. On the one hand "cross link " is the physical link display in a directory as a separate element, but on the other hand it is a copy of the usual link. For this reason for admins team this information would be useful.
Anyway you can change it:
***Open classes/DirAdmin.php and find the function***
function getNumLinksBy($aCause = '')
{
$sql = "SELECT COUNT(t1.`id`) ";
$sql .= "FROM `{$this->mPrefix}links` t1 ";
$sql .= "LEFT JOIN `{$this->mPrefix}link_categories` t2 ";
$sql .= "ON t1.`id` = t2.`id_link` ";
$sql .= $aCause;
return $this->mDb->getOne($sql);
}
***Replace with the following***
function getNumLinksBy($aCause = '')
{
$sql = "SELECT COUNT(t1.`id`) ";
$sql .= "FROM `{$this->mPrefix}links` t1 ";
$sql .= "LEFT JOIN `{$this->mPrefix}link_categories` t2 ";
$sql .= "ON t1.`id` = t2.`id_link` ";
$sql .= "AND t2.`crossed` = '0' ";
$sql .= $aCause;
return $this->mDb->getOne($sql);
}
***Save file***
Bryan Ex
12-21-2006, 06:31 PM
Hello Bryan,
This question is interesting and disputable. On the one hand "cross link " is the physical link display in a directory as a separate element, but on the other hand it is a copy of the usual link.
Exactly Dave... but that is also the problem I find in the admin panel. Cross links are included in the total number of active links but if you click on manage links they are then not included so there is no way to manage them... or even find them other than to browse your own web site looking. There is no way to manage cross links at all other than to browse. I have been waiting to see exactly how I need to manage cross links and now think I have the best way figured out. I will send you the description and if it needs to be a paid modification that is fine because I will need it for certain. One other thing I have noticed which is similar is that the category displayed in admin is also for the last cross link added and not to the actual "real" link which only makes things more confusing to manage. I will apply these changes which will certainly help... thanks once again David.
The good news is that my list of things to fix or change is growing very short. ;)
Bryan Ex
12-21-2006, 07:14 PM
Yahoo... this is starting to make sense to me. I've added your code above and then added a separate total for only cross links and then... made the total at the bottom to include both. Now I know how many sites I link to, how many duplicates I have, and how many total listing I have. I still need a way to manage the cross links but this is much better already. :yahoo:
Dave Baker
12-22-2006, 12:59 AM
Bryan :applause:
I duplicated functions described by you above, but I think it would be useful for those who would make this modification.
http://www.esyndicat.com/forum/about8004.html
I hope there will not be problems with its realization and work.
The good news is that my list of things to fix or change is growing very short.
I'm glad to hear it ;)
vBulletin® v3.7.0, Copyright ©2000-2009, Jelsoft Enterprises Ltd.