Jump to content

son.of.the.morning

Members
  • Posts

    292
  • Joined

  • Last visited

    Never

Posts posted by son.of.the.morning

  1. Due to the lack of speed that Imap provides i have to write some filters to avoid bringing in countless un-needed emails. I have had a little mess with the sort functions and other functions Imap has to offer but i can?t seem to drag out email in a specific order using imap_sort().

     

    // Connection method

    function _connection() {
    	$this->dir  = imap_open($this->host,$this->user,$this->password);
    	if($this->dir!=FALSE) {
    		return 'Connection successful.';
    		return $this->dir;
    	} else {
    		return 'Connection error: ';
    		return imap_last_error();
    	}
    }
    
    

     

    // List emails method

    function _readMail() {
    	if($this->collect) {
    		 $i    = 0;
    		 $mail = array();
    
    		 for($i=1; $i<20; $i++) {
    			$details = imap_fetch_overview($this->dir,$i,0);
    			$body    = imap_fetchbody($this->dir,$i,2);
    			$status  = $details[0]->seen ? 'read' : 'unread';
    			$from    = $details[0]->from;
    			$date    = $details[0]->date;
    			if(isset($details[0]->subject)) $subject = $details[0]->subject ; else $subject = 'no subject';
    			if(isset($details[0]->parts))   $attach   = 'yes'; else $attach = 'no';
    
    			if($status='unread') {
    			$mail[$i] = (array(
    					'subject' => $subject,
    					'status'  => $status,
    					'from'    => $from,
    					'date'    => $date,
    					'attach'  => $attach
    				)
    			);
    			}
    
    
    		  }// endforeach
    	} // endif
    
    	if(count($mail) < 0) {
    		return 'Alert: No mail in your inbox ('.$user.')';
    	} else {
    		return $mail;
    	}
    
    }
    

     

     

  2. In some cases i think it's a good thing to think outside the box and use custom controls rather than sticking to the native behaviour. There is always a way to programmatically make un-native elements work universally. Anyway that?s completely besides the point.

     

    What i was trying to explain is that I wanted to trigger the onclick event of a select element via an alternative element. (I.e. click a button and the corresponding select element will drop down). The reason behind this is I didn?t want the dropdown box to display on the iphone I just wanted a simple button which would append the value once select. Once the button would be click the iphone would then respond by showing the list items (in the iphones native way).

    I coded up a few lil code concoctions till i the penny dropped and i used a much more simple approach using CSS.

    I set the select elements opacity to 0 and placed the button over the top of it and just used a simple onChange event on the select element with simply append the button with the selected value.

     

    Works like a charm!

     

     

     

  3. I am about to start a this new project and was wondering if anyone was able to give me some DECENT words of advice. I need to be able to connect up to Gmail accounts and drag in email from a specific folder and display in multiple ways (i.e: list view, singular view).

     

    Once these emails have been read  (accessed on a singular view) then I want to pass them into a database and assign them with a ticket number (id). With every reply from the system user there will be an appended footer containing the ticket number. I plan to write some clever javascript to search for a ticket number in every email and compare it with ticket ids stored in the database.

     

    Any ideas or thoughts are welcome.

     

     

  4. That would be a good start haha, I have already looking over the functions available. However a need some ideas on how to go about building a class (set of) to cater for what i need. I was hoping that some people may have encounter this issue them self?s.

  5. Hey people,

     

    I need some collaborative thoughts here. I need to build up a class for email management using the Imap functionality. This is something i know nothing about so i need to understand and find a good solid approach to it.

     

    Fundamentally the class will need several methods...

     

    1. Connection

    2. Count

    3. List display

    4. Individually read

    5. Close connection

     

  6. Hey peeps, does anyone know of a way were i can have a button trigger a select element on a click event. For example i would like a simple button to be clicked and the drop down options to apear.

     

    This is for mobile  development (esp. iphone)

  7. I have been picking up cakephp for the last few months and i feel rather comfortable with it. I just want to see what other people find to be complex issues when programming in php so i can give them a shot and not only pick up on it but also test my current understanding

  8. Tryied to do a lil google search on it and couldnt find much.

     

     

    
    
    						SELECT * FROM results, actions, commitment_users AS commitment_member, commitment_users AS commitment_admin, users AS admin,users AS member, commitments
    						WHERE commitment_admin.user_id = admin.id
    							AND
    						admin.id = 1
    							AND
    						commitment_admin.commitment_user_type_id IN(2,3)
    							AND		
                                commitment_admin.commitment_id = commitment_member.commitment_id
    					        AND
    						commitment_member.commitment_id = commitments.id
    							AND
    						commitment_member.commitment_user_type_id IN (1,2) 
    							AND
    						actions.commitment_id = commitments.id
    							AND
    						results.action_id = actions.id
    							AND
    						results.user_id = member.id
    
    						GROUP BY results.id
    						ORDER BY results.date_created, results.time
    

     

    Here is my query at current

  9. Anyone have any idear how i would group records by time. For example if the timestamp of the record is in less 30mins affter the pervious record then group it with that record and so on and so forth. Facebook use somthing similar....

     

    "John likes HotBabes, SexyBitches and four other pages"

  10. I think i may have posted this problem before, however i still haven?t fount a suitable solution for it. I have a some complex queries that a lot of relationships or and selects of multiple tables. AS you probably already know it not a simple protocol to build these type of queries using cakephp's find method (maybe even impossible in some cases). Has anyone came across the same problem and if so could you please share your solution or even alternative approaches.

  11. I need to be able to create a global var of the current user so i don?t have to re-define it every time i query. I would i thought that this would of been suitable in the app controller but it seems as thought am wrong, any suggestions

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.