I am trying to get the users' saved searches showing correctly in the admin area. I am using the view_save_searches() function from the members_search.inc.php file and renaming it in the addon I am using.

The renamed function was barely or not changed at all. I got it to show in the admin area except that it does not show the saved searches' titles that is linked to the saved search but it does show the "Delete search" links.

I went over the codes like forever, tried to understand it, fondled with it, and I can't get the save searches title links to show. So I am posting the addon.inc.php file here to see if anyone can point out any errors of why it's not showing or have any ideas to get it to work. I am using version 2.5.8 right now but will upgrade 3.x soon.

Thanks in advance

-------------------
PHP Code:
<?php

/**
 * Open-Realty®
 * Open-Realty® is a registered trademark of Transparent Technologies, Inc.
 *
 * Open-Realty® is commercial software, redistribution is prohibited.
 * It is under the terms of the Transparent Technologies Commercial Software
 * License as published by Transparent Technologies, Inc.
 *
 * Open-Realty® is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the Open-Realty® License for more details:
 * http://transparent-tech.com/legal/commercial_license_agreement.html
 *
 * You should have received a copy of the Open-Realty® License along with
 * Open-Realty®; if not, write to Transparent Technologies, Inc.
 * 165 Orphan School Rd., Kingsley, PA 18826 USA
 *
 * @author Ryan C. Bonham <ryan@transparent-tech.com>
 * @copyright Transparent Technologies, Inc 2010
 * @link http://www.open-realty.org Open-Realty® Project
 * @link http://www.transparent-tech.com Transparent Technologies
 * @link http://transparent-tech.com/legal/commercial_license_agreement.html
 * Transparent Technologies Commercial Software License
 *
 * Version 2.2
 * - released at Dec,15/2010
 * - fixed $login::loginCheck calls
 * - improved the code and tested with Open-Realty® v.3.0.12
 *
 */


function checksearches_install_addon() {
}

function 
checksearches_show_admin_icons() {
    
$admin_link checksearches_display();
    return 
$admin_link;
}

function 
checksearches_load_template() {
}

function 
checksearches_run_action_user_template() {
}

function 
checkserches_run_action_admin_template() {
}

function 
checksearches_run_template_user_fields($tag '') {
    switch(
$tag) {
//        case 'addon_checksearches_display':
//            $data = checksearches_display();
//            break;
        
case 'addon_show_checksearches':
            
$data show_checksearches();
            break;
        default:
            
$data '';
            break;
        }
    return 
$data;
}

// Add-on Specific Function
function checksearches_display() {
    global 
$config$conn$lang;
    require_once(
$config['basepath'] . '/include/misc.inc.php');
    
$misc = new misc();
    
$display '';
    
$status login::loginCheck('Member');
    if (
$status === true) {
        
$display .= '<h2>Saved Investment Criteria</h2>';
        
$userID $misc->make_db_safe($_SESSION['userID']);
        
$sql "SELECT usersavedsearches_id, usersavedsearches_title, usersavedsearches_query_string FROM " $config['table_prefix'] . "usersavedsearches WHERE userdb_id = $userID ORDER BY usersavedsearches_title";
        
$recordSet $conn->Execute($sql);
        if (
$recordSet === false) {
            
$misc->log_error($sql);
        }
        
$num_columns $recordSet->RecordCount();
        if (
$num_columns == 0) {
            
$display .= 'You have no saved searches.';

        } else {
            while (!
$recordSet->EOF) {
                
$title $misc->make_db_unsafe($recordSet->fields['usersavedsearches_title']);
                if (
$title '') {
                    
$title $lang['saved_search'];
                }
                
$display .= '<a href="index.php?action=searchresults&amp;' $misc->make_db_unsafe($recordSet->fields['usersavedsearches_query_string']) . '">' $title '</a>&nbsp;&nbsp;&nbsp;&nbsp;<div class="note"><a href="index.php?action=delete_search&amp;searchID=' $misc->make_db_unsafe($recordSet->fields['usersavedsearches_id']) . '" onclick="return confirmDelete()">' $lang['delete_search'] . '</a></div><br /><br />';
                
$recordSet->MoveNext();
            } 
// end while
        

    } else {
        
$display $status;
    } 
    return 
$display;
}


// Add-on Specific Function
/*
function show_checksearches() {
    global $config, $conn, $lang;
    require_once($config['basepath'] . '/include/misc.inc.php');
    $misc = new misc();
    $display = '';
    $status = login::loginCheck('Member');
    if ($status === true) {
        $display .= '<h2>Saved Investment Criteria</h2>';
        $userID = $misc->make_db_safe($_SESSION['userID']);
        $sql = "SELECT usersavedsearches_id, usersavedsearches_title, usersavedsearches_query_string FROM " . $config['table_prefix'] . "usersavedsearches WHERE userdb_id = $userID ORDER BY usersavedsearches_title";
        $recordSet = $conn->Execute($sql);
        if ($recordSet === false) {
            $misc->log_error($sql);
        }
        $num_columns = $recordSet->RecordCount();
        if ($num_columns == 0) {
            $display .= 'You have no saved searches.';

        } else {
            while (!$recordSet->EOF) {
                $title = $misc->make_db_unsafe($recordSet->fields['usersavedsearches_title']);
                if ($title = '') {
                    $title = $lang['saved_search'];
                }
                $display .= '<a href="index.php?action=searchresults&amp;' . $misc->make_db_unsafe($recordSet->fields['usersavedsearches_query_string']) . '">' . $title . '</a>&nbsp;&nbsp;&nbsp;&nbsp;<div class="note"><a href="index.php?action=delete_search&amp;searchID=' . $misc->make_db_unsafe($recordSet->fields['usersavedsearches_id']) . '" onclick="return confirmDelete()">' . $lang['delete_search'] . '</a></div><br /><br />';
                $recordSet->MoveNext();
            } // end while
        } 
    } else {
        $display = $status;
    } 
    return $display;

*/
// end function checksearches_display()

function checksearches_addonmanager_help() {
}

function 
checksearches_uninstall_tables() {
}

// Add-on Specific Function
function checksearches_display_addon_link() {
}

// Add-on Specific Function
function checksearches_display_addon_page() {
}

// Add-on Specific Function
function checksearches_display_admin_page() {
}

?>