Support Forums

Excel file from listings

This is a discussion on Excel file from listings within the Technical Support forums, part of the Technical Support Forums category; Well, as we all know, 68C has a function to make an excel file of all the users (members) with ...


Go Back   68 Classifieds Forums > Technical Support Forums > Technical Support

This topic is resolved.

If you have a similar issue that this thread does not address, open a new related support topic.

 
Thread Tools Display Modes
Old 08-18-2009, 03:27 PM   #1
Junior Member
 
Join Date: Mar 2009
Posts: 14
Rep Power: 4
Ikky is on a distinguished road
Default Excel file from listings

Well, as we all know, 68C has a function to make an excel file of all the users (members) with their information in the admin side. I wanted to know if there's a similar function for all listings or if someone is developing this.
Ikky is offline  
Old 08-18-2009, 04:28 PM   #2
68 Classifieds Staff
 
Eric Barnes's Avatar
 
Join Date: Mar 2006
Location: Belmont, NC
Posts: 5,303
Rep Power: 125
Eric Barnes is a jewel in the rough
Default

Currently it does not have this as an option. However it should not be to hard to build. If you know a little php.

PHP Code:
<?php
require_once('includes/init.php');
require_once(
FILESYSTEM_PATH .'includes/classes/kernel/Pagination.php');

    require_once(
'../includes/classes/kernel/Listings.php');
    
$Listings= new Listings;
        
        
$options '';
        
$list=$Listings->getAllListings($options1'9999');
        
$i=0;
        
$headings='';
        foreach (
$list['list'][0] as $key => $value) {
            
$headings.= $key.",";
            
$i++;
        }
        
$csvoutput rtrim($headings', ');
        
$csvoutput .= "\n";
        
//now the users
        
$i=1;
        
$next=0;
        
$users='';
        foreach (
$list['list'] as $v1) {
            foreach (
$v1 as $key => $value) {
                
$users .= $value.',';
                
$next++;
            }
            
$users rtrim($users',');
            
$users .= "\n";
            
$next=0;
            
$i++;
        }
        
$csvoutput .= $users;
        
    
header "Content-Type: application/force-download" );
    
header "Content-Type: application/octet-stream" );
    
header "Content-Type: application/download" );
    
header "Content-Type: text/csv" );
    
header "Content-Disposition: attachment; filename=listings.csv");
    
header "Content-Transfer-Encoding: binary" );
    
header "Accept-Ranges: bytes" );
    
header "Content-Length: ".strlen $csvoutput ) );
    echo 
$csvoutput;
Save that as export_listings.php and upload to your administration directory.
__________________
Eric Barnes
68 Classifieds Developer
Customer Area | Issue Tracker | Documentation | 68C Mods | 68 @ Twitter | My Modules
Eric Barnes is offline  
Closed Thread

Tags
code , excel , export listing , function , listing , user

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Is there a sql file or similar to import dummy listings? sitewonders Technical Support 6 06-12-2009 03:14 PM
Is there a way to upload listings via .xls file? Or do they need to be 1 at a time. cheungri Technical Support 1 03-28-2009 07:47 PM
Excel Help Part 2 bowers01 Off Topic 7 08-29-2008 04:37 PM
Excel Help Needed bowers01 Off Topic 2 08-19-2008 05:31 AM
Enabled extra field and pdf file keeps "falling out" of previous listings sedonagate v3.1 Questions & Support 3 09-21-2006 09:50 PM


All times are GMT -4. The time now is 10:15 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0