Results 1 to 6 of 6

Thread: Can't Display Users' Saved Searches Addon in Admin Correctly

  1. #1
    Join Date
    Dec 2008
    Location
    Dallas, TX
    Posts
    30

    Default Can't Display Users' Saved Searches Addon in Admin Correctly

    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() {
    }

    ?>
    ~Knute~
    "Getting it done is better than perfect"

  2. #2
    Join Date
    Jul 2005
    Location
    Sao Paulo, BRAZIL
    Posts
    3,763

    Default Re: Can't Display Users' Saved Searches Addon in Admin Correctly

    Here is a start for you: http://eduardomarques.com/downloads/...cksearches.zip
    As it is, will work at v.2.5.8 and v.3.1.1

    Eduardo

    Open-Realty® DOCs
    We can easily forgive a child who is afraid of the dark; the real tragedy of life is when men are afraid of the light. (Author Unknown)

  3. #3
    Join Date
    Dec 2008
    Location
    Dallas, TX
    Posts
    30

    Default Re: Can't Display Users' Saved Searches Addon in Admin Correctly

    Eduardo, thank you for fixing it for me. Is there a way to get the addon to display the info in the or_index.html file? That way the members are able to see the info as soon as they sign in the admin area instead of a link to the addon's page.

    And is there a way to get rid of the word "Addons" showing above the addon links and modify where the addons should be displayed in the admin area? When I have like a few addons for the admin area, I am limited to where they should be displayed and only limited to showing links in columns.
    ~Knute~
    "Getting it done is better than perfect"

  4. #4
    Join Date
    Dec 2008
    Location
    Dallas, TX
    Posts
    30

    Default Re: Can't Display Users' Saved Searches Addon in Admin Correctly

    Never mind my question about how to get rid of the "Addons" title showing above the addon links. I figured it out. All I had to do was to use /admin/index.php?action=addon_checksearches_show in the links. But what about getting the list of saved searches showing in the or_index.html? Is it possible?
    ~Knute~
    "Getting it done is better than perfect"

  5. #5
    Join Date
    Jul 2005
    Location
    Sao Paulo, BRAZIL
    Posts
    3,763

    Default Re: Can't Display Users' Saved Searches Addon in Admin Correctly

    Quote Originally Posted by marketingisking View Post
    Is there a way to get the addon to display the info in the or_index.html file?
    Yes that's possible. You will need to edit the add-on for that.

    Quote Originally Posted by marketingisking View Post
    That way the members are able to see the info as soon as they sign in the admin area instead of a link to the addon's page.
    No... you dind't understand a basic detail about Open-Realty: the backend or admin area IS NOT for Members. So that's impossible. If a member while logged, try to access the admin area he will be automatically sent to the frontend - no matter what.

    Eduardo

    Open-Realty® DOCs
    We can easily forgive a child who is afraid of the dark; the real tragedy of life is when men are afraid of the light. (Author Unknown)

  6. #6
    Join Date
    Dec 2008
    Location
    Dallas, TX
    Posts
    30

    Default Re: Can't Display Users' Saved Searches Addon in Admin Correctly

    Quote Originally Posted by ebmarques View Post
    No... you dind't understand a basic detail about Open-Realty: the backend or admin area IS NOT for Members. So that's impossible. If a member while logged, try to access the admin area he will be automatically sent to the frontend - no matter what.

    Eduardo
    I apologize for not being clear. I meant users that are agents, not members, but you already answered my question. When I have time, I will look into how to get addons to display info in the admin area instead a link to the addon page. Again, thank you for to help me.
    ~Knute~
    "Getting it done is better than perfect"

Similar Threads

  1. Saved searches showing for all users
    By mrealty in forum General Help (CLOSED)
    Replies: 0
    Last Post: 10-12-2008, 12:06 PM
  2. Saved Searches - no emails to users
    By blurtsmum in forum General Help (CLOSED)
    Replies: 20
    Last Post: 04-02-2008, 02:19 PM
  3. saved searches of deleted users
    By or! in forum General Help (CLOSED)
    Replies: 1
    Last Post: 05-15-2007, 06:34 PM
  4. Saved Searches
    By jared in forum General Help (CLOSED)
    Replies: 6
    Last Post: 08-15-2006, 05:11 PM
  5. Saved searches
    By RealEstate in forum Bugs (CLOSED)
    Replies: 2
    Last Post: 07-13-2004, 01:18 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •