[MOD]CSV Import

  1. 15 years ago

    Edit fop2/lib/dbgrid.php

    Find:

    private $allow_export=true;

    Add under:

    private $allow_import=true;

    Find:

    if ($this->allow_export) {
                $req=$this->set_request('dbgrid_action','csv',false);
                if($sep==1) { $buttons.=" <div class='btnseparator'></div>"; }
    
                $buttons.="
                        <div class='fbutton'>
                            <span class='tbImgLink icon_export'>&nbsp;</span>
                            <span class='btnText' onclick='javascript:location=\"".SELF.$req."\"'>".trans('Export')."</span>
                        </div>
                ";
                $sep=1;
            }

    Add Above:

    if ($this->allow_import) {
                $req=$this->set_request('dbgrid_action','csv',false);
                if($sep==1) { $buttons.=" <div class='btnseparator'></div>"; }
    
                $buttons.="
                        <div class='fbutton'>
                            <span class='tbImgLink icon_export'>&nbsp;</span>
                            <span class='btnText' onclick='javascript:location=\"import.php\"'>".trans('Import')."</span>
                        </div>
                ";
                $sep=1;
            }

    Save and upload

    Upload import.php to the fop2 root dir
    Upload output.sql to the fop2 root dir and CHMOD 777
    Update phonebook.csv with your names, numbers, etc etc and upload to fop2 root dir

    Login to fop2 and click Visual Phonebook then import and all should be done.

    [url=http://domain1647423.sites.fasthosts.com/csvimport.zip:fypvwofn]Download Files[/url:fypvwofn]

or Sign Up to reply!