wrong variable passed

This commit is contained in:
Friendika 2011-04-11 15:45:19 -07:00
parent 21c48a1476
commit ff15ea0993
3 changed files with 13 additions and 15 deletions

View File

@ -2,7 +2,7 @@
set_time_limit(0); set_time_limit(0);
define ( 'FRIENDIKA_VERSION', '2.1.945' ); define ( 'FRIENDIKA_VERSION', '2.1.946' );
define ( 'DFRN_PROTOCOL_VERSION', '2.21' ); define ( 'DFRN_PROTOCOL_VERSION', '2.21' );
define ( 'DB_UPDATE_VERSION', 1048 ); define ( 'DB_UPDATE_VERSION', 1048 );

View File

@ -1,7 +1,7 @@
<?php <?php
function conversation(&$a,$r, $mode, $update) { function conversation(&$a, $items, $mode, $update) {
require_once('bbcode.php'); require_once('bbcode.php');
@ -23,8 +23,6 @@ function conversation(&$a,$r, $mode, $update) {
$writable = can_write_wall($a,$profile_owner); $writable = can_write_wall($a,$profile_owner);
} }
if($update) if($update)
$return_url = $_SESSION['return_url']; $return_url = $_SESSION['return_url'];
else else
@ -35,7 +33,7 @@ function conversation(&$a,$r, $mode, $update) {
// We will use a local profile photo if they are one of our contacts // We will use a local profile photo if they are one of our contacts
// otherwise we have to get the photo from the item owner's site // otherwise we have to get the photo from the item owner's site
$author_contacts = extract_item_authors($r,local_user()); $author_contacts = extract_item_authors($items,local_user());
$cmnt_tpl = load_view_file('view/comment_item.tpl'); $cmnt_tpl = load_view_file('view/comment_item.tpl');
@ -47,7 +45,7 @@ function conversation(&$a,$r, $mode, $update) {
$alike = array(); $alike = array();
$dlike = array(); $dlike = array();
if(count($r)) { if(count($items)) {
if($mode === 'network-new' || $mode === 'search') { if($mode === 'network-new' || $mode === 'search') {
@ -57,7 +55,7 @@ function conversation(&$a,$r, $mode, $update) {
$tpl = load_view_file('view/search_item.tpl'); $tpl = load_view_file('view/search_item.tpl');
$droptpl = load_view_file('view/wall_fake_drop.tpl'); $droptpl = load_view_file('view/wall_fake_drop.tpl');
foreach($r as $item) { foreach($items as $item) {
$comment = ''; $comment = '';
$owner_url = ''; $owner_url = '';
@ -150,19 +148,19 @@ function conversation(&$a,$r, $mode, $update) {
// Store the result in the $comments array // Store the result in the $comments array
$comments = array(); $comments = array();
foreach($r as $rr) { foreach($items as $item) {
if(intval($rr['gravity']) == 6) { if(intval($item['gravity']) == 6) {
if(! x($comments,$rr['parent'])) if(! x($comments,$item['parent']))
$comments[$rr['parent']] = 1; $comments[$item['parent']] = 1;
else else
$comments[$rr['parent']] += 1; $comments[$item['parent']] += 1;
} }
} }
// map all the like/dislike activities for each parent item // map all the like/dislike activities for each parent item
// Store these in the $alike and $dlike arrays // Store these in the $alike and $dlike arrays
foreach($r as $item) { foreach($items as $item) {
like_puller($a,$item,$alike,'like'); like_puller($a,$item,$alike,'like');
like_puller($a,$item,$dlike,'dislike'); like_puller($a,$item,$dlike,'dislike');
} }
@ -171,7 +169,7 @@ function conversation(&$a,$r, $mode, $update) {
$blowhard = 0; $blowhard = 0;
$blowhard_count = 0; $blowhard_count = 0;
foreach($r as $item) { foreach($items as $item) {
$comment = ''; $comment = '';
$template = $tpl; $template = $tpl;

View File

@ -291,7 +291,7 @@ function profile_content(&$a, $update = 0) {
require_once('include/conversation.php'); require_once('include/conversation.php');
$o .= conversation($a,$r,'profile',$display); $o .= conversation($a,$r,'profile',$update);
if(! $update) { if(! $update) {