added comments, make typo checker work with redefined plural string functions
This commit is contained in:
parent
0f8bcacfdd
commit
00b5f6f8a1
3 changed files with 59 additions and 3 deletions
|
@ -114,7 +114,7 @@ function network_content(&$a, $update = 0) {
|
||||||
'$lockstate' => $lockstate,
|
'$lockstate' => $lockstate,
|
||||||
'$acl' => populate_acl((($group) ? $group_acl : $a->user), $celeb),
|
'$acl' => populate_acl((($group) ? $group_acl : $a->user), $celeb),
|
||||||
'$bang' => (($group) ? '!' : ''),
|
'$bang' => (($group) ? '!' : ''),
|
||||||
'$profile_uid' => $_SESSION['uid']
|
'$profile_uid' => local_user()
|
||||||
));
|
));
|
||||||
|
|
||||||
|
|
||||||
|
@ -190,6 +190,9 @@ function network_content(&$a, $update = 0) {
|
||||||
|
|
||||||
|
|
||||||
if($nouveau) {
|
if($nouveau) {
|
||||||
|
|
||||||
|
// "New Item View" - show all items unthreaded in reverse created date order
|
||||||
|
|
||||||
$r = q("SELECT `item`.*, `item`.`id` AS `item_id`,
|
$r = q("SELECT `item`.*, `item`.`id` AS `item_id`,
|
||||||
`contact`.`name`, `contact`.`photo`, `contact`.`url`, `contact`.`rel`,
|
`contact`.`name`, `contact`.`photo`, `contact`.`url`, `contact`.`rel`,
|
||||||
`contact`.`network`, `contact`.`thumb`, `contact`.`dfrn-id`, `contact`.`self`,
|
`contact`.`network`, `contact`.`thumb`, `contact`.`dfrn-id`, `contact`.`self`,
|
||||||
|
@ -206,6 +209,10 @@ function network_content(&$a, $update = 0) {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
||||||
|
// Normal conversation view
|
||||||
|
// First fetch a known number of parent items
|
||||||
|
|
||||||
$r = q("SELECT `item`.`id` AS `item_id`, `contact`.`uid` AS `contact_uid`
|
$r = q("SELECT `item`.`id` AS `item_id`, `contact`.`uid` AS `contact_uid`
|
||||||
FROM `item` LEFT JOIN `contact` ON `contact`.`id` = `item`.`contact-id`
|
FROM `item` LEFT JOIN `contact` ON `contact`.`id` = `item`.`contact-id`
|
||||||
WHERE `item`.`uid` = %d AND `item`.`visible` = 1 AND `item`.`deleted` = 0
|
WHERE `item`.`uid` = %d AND `item`.`visible` = 1 AND `item`.`deleted` = 0
|
||||||
|
@ -218,6 +225,9 @@ function network_content(&$a, $update = 0) {
|
||||||
intval($a->pager['itemspage'])
|
intval($a->pager['itemspage'])
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
|
// Then fetch all the children of the parents that are on this page
|
||||||
|
|
||||||
$parents_arr = array();
|
$parents_arr = array();
|
||||||
$parents_str = '';
|
$parents_str = '';
|
||||||
|
|
||||||
|
@ -243,6 +253,10 @@ function network_content(&$a, $update = 0) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// find all the authors involved in remote conversations
|
||||||
|
// 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
|
||||||
|
|
||||||
$author_contacts = extract_item_authors($r,local_user());
|
$author_contacts = extract_item_authors($r,local_user());
|
||||||
|
|
||||||
$cmnt_tpl = load_view_file('view/comment_item.tpl');
|
$cmnt_tpl = load_view_file('view/comment_item.tpl');
|
||||||
|
@ -258,6 +272,8 @@ function network_content(&$a, $update = 0) {
|
||||||
|
|
||||||
if($nouveau) {
|
if($nouveau) {
|
||||||
|
|
||||||
|
// "New Item View" - just loop through the items and format them minimally for display
|
||||||
|
|
||||||
$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');
|
||||||
|
|
||||||
|
@ -325,6 +341,12 @@ function network_content(&$a, $update = 0) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Normal View
|
||||||
|
|
||||||
|
|
||||||
|
// Figure out how many comments each parent has
|
||||||
|
// (Comments all have gravity of 6)
|
||||||
|
// Store the result in the $comments array
|
||||||
|
|
||||||
$comments = array();
|
$comments = array();
|
||||||
foreach($r as $rr) {
|
foreach($r as $rr) {
|
||||||
|
@ -336,6 +358,9 @@ function network_content(&$a, $update = 0) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// map all the like/dislike activities for each parent item
|
||||||
|
// Store these in the $alike and $dlike arrays
|
||||||
|
|
||||||
foreach($r as $item) {
|
foreach($r 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');
|
||||||
|
@ -353,9 +378,18 @@ function network_content(&$a, $update = 0) {
|
||||||
$sparkle = '';
|
$sparkle = '';
|
||||||
$owner_url = $owner_photo = $owner_name = '';
|
$owner_url = $owner_photo = $owner_name = '';
|
||||||
|
|
||||||
if(((activity_match($item['verb'],ACTIVITY_LIKE)) || (activity_match($item['verb'],ACTIVITY_DISLIKE))) && ($item['id'] != $item['parent']))
|
|
||||||
|
// We've already parsed out like/dislike for special treatment. We can ignore them now
|
||||||
|
|
||||||
|
if(((activity_match($item['verb'],ACTIVITY_LIKE))
|
||||||
|
|| (activity_match($item['verb'],ACTIVITY_DISLIKE)))
|
||||||
|
&& ($item['id'] != $item['parent']))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
// Take care of author collapsing and comment collapsing
|
||||||
|
// If a single author has more than 3 consecutive top-level posts, squash the remaining ones.
|
||||||
|
// If there are more than two comments, squash all but the last 2.
|
||||||
|
|
||||||
if($item['id'] == $item['parent']) {
|
if($item['id'] == $item['parent']) {
|
||||||
if($blowhard == $item['cid'] && (! $item['self'])) {
|
if($blowhard == $item['cid'] && (! $item['self'])) {
|
||||||
$blowhard_count ++;
|
$blowhard_count ++;
|
||||||
|
@ -388,6 +422,8 @@ function network_content(&$a, $update = 0) {
|
||||||
$o .= '</div>';
|
$o .= '</div>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$redirect_url = $a->get_baseurl() . '/redir/' . $item['cid'] ;
|
$redirect_url = $a->get_baseurl() . '/redir/' . $item['cid'] ;
|
||||||
|
|
||||||
$lock = ((($item['private']) || (($item['uid'] == local_user()) && (strlen($item['allow_cid']) || strlen($item['allow_gid'])
|
$lock = ((($item['private']) || (($item['uid'] == local_user()) && (strlen($item['allow_cid']) || strlen($item['allow_gid'])
|
||||||
|
@ -546,6 +582,9 @@ function network_content(&$a, $update = 0) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if(! $update) {
|
if(! $update) {
|
||||||
|
|
||||||
|
// if author collapsing is in force but didn't get closed, close it off now.
|
||||||
|
|
||||||
if($blowhard_count > 3)
|
if($blowhard_count > 3)
|
||||||
$o .= '</div>';
|
$o .= '</div>';
|
||||||
|
|
||||||
|
|
|
@ -37,6 +37,11 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(x($a->config,'php_path'))
|
||||||
|
$phpath = $a->config['php_path'];
|
||||||
|
else
|
||||||
|
$phpath = 'php';
|
||||||
|
|
||||||
echo "String files\n";
|
echo "String files\n";
|
||||||
|
|
||||||
echo 'util/strings.php' . "\n";
|
echo 'util/strings.php' . "\n";
|
||||||
|
@ -47,5 +52,6 @@
|
||||||
|
|
||||||
foreach($files as $file) {
|
foreach($files as $file) {
|
||||||
echo $file . "\n";
|
echo $file . "\n";
|
||||||
include_once($file);
|
passthru($phpath . ' util/typohelper.php ' . $file);
|
||||||
|
// include_once($file);
|
||||||
}
|
}
|
||||||
|
|
11
util/typohelper.php
Normal file
11
util/typohelper.php
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
$str = <<< EOT
|
||||||
|
error_reporting(E_ERROR | E_WARNING | E_PARSE );
|
||||||
|
ini_set('display_errors', '1');
|
||||||
|
ini_set('log_errors','0');
|
||||||
|
EOT;
|
||||||
|
|
||||||
|
$str .= str_replace('<?php', '', file_get_contents($argv[1]));
|
||||||
|
|
||||||
|
eval($str);
|
Loading…
Reference in a new issue