Skip to content

Commit

Permalink
fixed twitter-omb-aggregator
Browse files Browse the repository at this point in the history
  • Loading branch information
voitto committed Nov 21, 2008
1 parent 9cf9d6d commit be775c1
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 14 deletions.
5 changes: 2 additions & 3 deletions app/plugins/wp.php
Original file line number Diff line number Diff line change
Expand Up @@ -1744,7 +1744,7 @@ function wp_add_options($prefix,$options) {
'stylesheet_url'=>theme_path()."style.css",
'stylesheet_directory'=>theme_path(),
'pingback_url'=>base_url(true),
'template_url'=>theme_path()
'template_url'=>theme_path(true)
);

$optiondata = array(
Expand All @@ -1767,8 +1767,7 @@ function wp_add_options($prefix,$options) {
define('ARRAY_A', 'ARRAY_A', false);
define('ARRAY_N', 'ARRAY_N', false);


define('TEMPLATEPATH', theme_path() );
define('TEMPLATEPATH', theme_path(true) );


$limit_max = get_option( 'posts_per_page' );
Expand Down
23 changes: 17 additions & 6 deletions db/library/dbscript/_functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -1053,7 +1053,7 @@ function render_theme( $theme ) {
require_once( $folder . "index.html" );
}

function theme_path() {
function theme_path($noslash = false) {

global $pretty_url_base;

Expand All @@ -1062,7 +1062,12 @@ function theme_path() {
else
$base = "";

return $base . $GLOBALS['PATH']['themes'] . environment('theme') . DIRECTORY_SEPARATOR;
$path = $base . $GLOBALS['PATH']['themes'] . environment('theme') . DIRECTORY_SEPARATOR;

if ($noslash && "/" == substr($path,-1))
$path = substr($path,0,-1);

return $path;

}

Expand Down Expand Up @@ -2465,14 +2470,20 @@ function app_init($appname) {
}


function array_sort($array,$key){
function array_sort($array, $key, $max=false)
{
for ($i = 0; $i < sizeof($array); $i++) {
$sort_values[$i] = $array[$i][$key];
$sort_values[$i] = $array[$i][$key];
}
arsort ($sort_values);
asort ($sort_values);
reset ($sort_values);
while (list ($arr_key, $arr_val) = each ($sort_values)) {
$sorted_arr[] = $array[$arr_key];
if ($max) {
if (count($sorted_arr) < $max)
$sorted_arr[] = $array[$arr_key];
} else {
$sorted_arr[] = $array[$arr_key];
}
}
return $sorted_arr;
}
Expand Down
7 changes: 5 additions & 2 deletions db/library/dbscript/mysql.php
Original file line number Diff line number Diff line change
Expand Up @@ -623,11 +623,14 @@ function get_query( $id=NULL, $find_by=NULL, &$model ) {

$findfirst = true;
$op = "AND";
$eq = '=';
foreach( $model->find_by as $col=>$val ) {
if (is_array($val))
list($col,$val) = each($val);
if ($col == 'op') {
$op = $val;
} elseif ($col =='eq') {
$eq = $val;
} else {

if (strpos($col,".") === false)
Expand All @@ -636,9 +639,9 @@ function get_query( $id=NULL, $find_by=NULL, &$model ) {
$field = $col;

if ($findfirst) {
$sql .= " WHERE $field = '$val' ";
$sql .= " WHERE $field $eq '$val' ";
} else {
$sql .= " $op $field = '$val' ";
$sql .= " $op $field $eq '$val' ";
}
$findfirst = false;

Expand Down
9 changes: 6 additions & 3 deletions db/library/dbscript/postgresql.php
Original file line number Diff line number Diff line change
Expand Up @@ -694,11 +694,14 @@ function get_query( $id=NULL, $find_by=NULL, &$model ) {

$findfirst = true;
$op = "AND";
$eq = '=';
foreach( $model->find_by as $col=>$val ) {
if (is_array($val))
list($col,$val) = each($val);
if ($col == 'op') {
if ($col == 'op') {
$op = $val;
} elseif ($col =='eq') {
$eq = $val;
} else {

if (strpos($col,".") === false)
Expand All @@ -707,9 +710,9 @@ function get_query( $id=NULL, $find_by=NULL, &$model ) {
$field = $col;

if ($findfirst) {
$sql .= " WHERE $field = '$val' ";
$sql .= " WHERE $field $eq '$val' ";
} else {
$sql .= " $op $field = '$val' ";
$sql .= " $op $field $eq '$val' ";
}
$findfirst = false;

Expand Down

0 comments on commit be775c1

Please sign in to comment.