CCK example

A very thorough example by alan.pinkert.

LowMemory's original example

LowMemory's verbatim original example for Views PHP Filter, to my knowledge the first such example for 6.x in the handbook. I owe LowMemory thanks for officially kicking off this section.

nfd's "Super Simple Example"

A posting to the Views PHP Filter documentation support issue by nfd; copied here as he wrote it, with one small edit made to fix a problem that cropped up in that comment thread Probably the nearly-canonical "simple use" of Views PHP Filter. Thanks again, nfd!
-slinkygn

------

Posted by nfd on September 7, 2010 at 7:09am
Super Simple Example

Here is a good version of the script from #6 that essentually allows one to run a simple custom SQL query without node related retrieving variables involved.

$todaydayofweek = date('l');  // Any special variables should be first declared. In this case I am declaring the current day of week. Wash, rinse and repeat with as many variables as you need.

$nodeids = array();  // Creates the array that will be passed back to the filter.

$my_result = db_query("SELECT nid FROM node WHERE type LIKE 'ec_forecast_weather_data' AND title NOT LIKE '%$todaydayofweek%'");  // This is the query from the database. Place your custom SQL Query here between the set of quotation marks and brackets. Note how the custom variable is included in the SQL query.

while ($my_row = db_fetch_array($my_result))  // Adds the node ids to the array.

{
$nodeids[] = $my_row['nid'];
}

return $nodeids;  // Passes the filter back

jPlayer

Here an example to get a jPlayer-Playlists with titels in views:
Views & jPlayer

Sort criteria

The following sort criteria are currently available:

  • Hostname
    Hostname of the user who triggered the event.

  • Location
    URL of the origin of the event.

  • Message
    The actual message of the log entry.

  • Operations
    Operation links for the event.

  • Referer
    URL of the previous page.

Filter criteria

The following filter criteria are currently available:

  • Hostname
    Hostname of the user who triggered the event.

  • Location
    URL of the origin of the event.

  • Message
    The actual message of the log entry.

  • Operations
    Operation links for the event.

  • Referer
    URL of the previous page.

Pages

Subscribe with RSS Subscribe to RSS - Views