Jump to content


acctman

Member Since 28 Jul 2007
Offline Last Active Jan 18 2013 04:49 PM

Posts I've Made

In Topic: Simple HTML Dom... get width value

18 January 2013 - 02:01 AM

According to the Sourceforge Code site:

$element = $html->find("font[size=-1]", 3);
echo "Width is: " . $element->width . '<br />';



I'm trying to check if there is and image after the <td> tag, and if there is grab the width value. the method i'm using below is not working

    $element = $html->find("td", 23);
    if ($element->innertext != null) {
        $element = $html->find("td img[src=http://pictures.domain.com/images/7.gif]");
        echo $element->width . '<br />';        
    } else {
       echo "empty";
    }

In Topic: Error in SQL syntax LEFT JOIN

09 May 2012 - 05:03 AM

I almost have the data I want... this is a bit tricky. (pic at bottom)

The query below returns all records with a status of Member-id5 but I need to filter that look up. if I did a simple query on ect. (exp_channel_titles) for author_id 323 I would get 5 results. Of those 5 results one has a status of 'Member-id5', another one has a status of 'complete' and title of %Member%. That's the deciding factor. If that row exist with status = complete and title = %Member% then its okay to grab the entry_id of row status = Member-id5 to use for looking up the data in ecd (exp_channel_data) with  in it.
SELECT
             ect.entry_id
        ,    ect.author_id
        ,    ect.title
        ,    ect.status
        ,    ecd.field_id_13
        ,    ecd.field_id_14
        ,    ecd.field_id_15
        ,    ecd.field_id_25
        ,    ecd.field_id_27
        ,    ecd.field_id_28
        ,    ecd.field_id_29
        ,    ecd.field_id_30
        ,    ecd.field_id_31
        ,    ecd.field_id_32
        ,    ecd.field_id_33
        ,    ecd.field_id_34
        ,    ecd.field_id_35
        ,    exm.email
    FROM exp_channel_titles as ect
    LEFT JOIN exp_channel_data as ecd
      ON ecd.entry_id = ect.entry_id
    LEFT JOIN exp_members as exm
      ON exm.member_id = ect.author_id
WHERE ect.status = 'Members-id5'


In Topic: Error in SQL syntax LEFT JOIN

08 May 2012 - 05:21 AM

Add those columns to the initial list of selected columns.

Why are you using subqueries?


do add it like this exm.email, ecd.field_id_14, ecd.field_id_15 ... and is there a better way to do it other than subqueries?

In Topic: Error in SQL syntax LEFT JOIN

08 May 2012 - 04:46 AM

Subqueries need to be enclosed in parentheses and table subqueries, like yours, need an alias. eg

LEFT JOIN (SELECT etc ) as X


here's what I got so far.... my out put is only should entry_id, author_id, title and status. What I need to show in the results is all the fields_* and email
SELECT 
    ect.entry_id,
    ect.author_id,
    ect.title,
    ect.status
FROM exp_channel_titles as ect

LEFT JOIN
(SELECT
    entry_id, 
    field_id_14,
    field_id_15,
    field_id_25,
    field_id_27, 
    field_id_28, 
    field_id_29, 
    field_id_30,
    field_id_31,
    field_id_32,
    field_id_33,
    field_id_34,
    field_id_35
FROM exp_channel_data) as ecd 
ON ecd.entry_id = ect.entry_id

LEFT JOIN
(SELECT   
    member_id,
    email
FROM exp_members) as exm
ON exm.member_id = ect.author_id

WHERE ect.title LIKE '%Member%' 
AND ect.status = 'complete'

In Topic: Authenticating YouTube account?

21 March 2012 - 12:02 PM

I use this:

$youtubeID = 'some_user';

 // set video data feed URL
$feedURL = 'http://gdata.youtube.com/feeds/api/videos/' . $youtubeID;
		
// read feed into SimpleXML object
if( !$entry = simplexml_load_file($feedURL))
{
	// kick error
} else {
	// run lib
}


this issue I'm having is that I have unlisted videos that do not show up on the feeds list. So I need to authenticate myself so I can grab the video ID's.

Cheap Linux VPS from $5
SSD Storage, 30 day Guarantee
1 TB of BW, 100% Network Uptime

AlphaBit.com