Permalink
Browse files

jun09 branch

  • Loading branch information...
Jeff Reifman Jeff Reifman
Jeff Reifman authored and Jeff Reifman committed Jun 9, 2009
1 parent 0da2d3f commit 0eb47e5294cd794c3ac59ac3914b1c9706305f1f
Showing with 2,412 additions and 5,989 deletions.
  1. +1 −1 core/classes/adCode.class.php
  2. +1 −1 core/classes/challenges.class.php
  3. +1 −1 core/classes/comments.class.php
  4. +7 −5 core/classes/content.class.php
  5. +139 −35 core/classes/cron.class.php
  6. +2 −0 core/classes/dbConsoleModel.class.php
  7. +4 −2 core/classes/dynamicTemplate.class.php
  8. +24 −0 core/classes/newswire.class.php
  9. +8 −0 core/classes/researchLogDump.class.php
  10. +64 −5 core/classes/researchUserCollective.class.php
  11. +3 −0 core/classes/template.class.php
  12. +4 −0 core/engine.php
  13. +9 −50 core/utilities/initDatabase.php
  14. +2 −1 docs/setup.txt
  15. +37 −2 facebook/Social Media Toolkit.tmproj
  16. +22 −1 facebook/ajax.php
  17. +231 −80 facebook/classes/account.class.php
  18. +0 −3 facebook/classes/actionTeam.class.php
  19. +0 −10 facebook/classes/facebookCron.class.php
  20. +0 −43 facebook/classes/pageWall.class.php
  21. +17 −10 facebook/classes/pages.class.php
  22. +1 −1 facebook/classes/profileBoxes.class.php
  23. +9 −2 facebook/classes/session.class.php
  24. +0 −31 facebook/emailAttach.php
  25. +3 −0 facebook/index.php
  26. +125 −26 facebook/lib/facebook.php
  27. +1 −1 facebook/lib/facebook_desktop.php
  28. +828 −97 facebook/lib/facebookapi_php5_restlib.php
  29. +64 −16 facebook/pages/pageAccount.class.php
  30. +34 −0 facebook/pages/pagePostStory.class.php
  31. +8 −0 facebook/postAuth.php
  32. +15 −2 facebook/scripts/newsroom.js
  33. +53 −53 facebook/styles/default.css
  34. +5 −19 facebook/utilities/initDatabase.php
  35. +7 −0 php/config.php
  36. +0 −9 php/console/actions/assign_widget.php
  37. +0 −14 php/console/actions/deleteFeedTemplates.php
  38. +0 −21 php/console/actions/downloadSettings.php
  39. +0 −3 php/console/actions/editTemplates.php
  40. +0 −11 php/console/actions/flushFeedList.php
  41. +0 −11 php/console/actions/initCronJobs.php
  42. +0 −13 php/console/actions/initProfileBox.php
  43. +0 −14 php/console/actions/registerFeedTemplates.php
  44. +0 −13 php/console/actions/remove_widget_from_stories.php
  45. +0 −11 php/console/actions/reset_widget_cover.php
  46. +0 −11 php/console/actions/reset_widget_sidebar.php
  47. +0 −16 php/console/actions/runCronJobs.php
  48. +0 −22 php/console/actions/siteStatus.php
  49. +0 −11 php/console/actions/syncAllocations.php
  50. +0 −16 php/console/actions/update_widget_location.php
  51. +0 −19 php/console/actions/uploadSettings.php
  52. +84 −2,315 php/console/console.php
  53. +15 −0 php/console/footer.php
  54. +31 −8 php/console/global.php
  55. +337 −57 php/console/header.php
  56. +91 −51 php/console/index.php
  57. +8 −1 php/console/save_template.php
  58. +0 −29 php/console/views/add_story_widget.php
  59. +0 −57 php/console/views/assign_prize.php
  60. +0 −463 php/console/views/award_prize.php
  61. +0 −89 php/console/views/challenge_fields.php
  62. +0 −53 php/console/views/challenges.php
  63. +0 −27 php/console/views/comment_fields.php
  64. +0 −38 php/console/views/comments.php
  65. +0 −39 php/console/views/completed_challenge_fields.php
  66. +0 −53 php/console/views/completed_challenges.php
  67. +0 −37 php/console/views/cronJobs.php
  68. +0 −43 php/console/views/dashboard.php
  69. +0 −43 php/console/views/friend_invite_credits.php
  70. +0 −73 php/console/views/leaders.php
  71. +0 −38 php/console/views/member_emails.php
  72. +0 −75 php/console/views/member_fields.php
  73. +0 −54 php/console/views/members.php
  74. +0 −15 php/console/views/modify_challenge.php
  75. +0 −14 php/console/views/modify_comment.php
  76. +0 −14 php/console/views/modify_completed_challenge.php
  77. +0 −14 php/console/views/modify_member.php
  78. +0 −14 php/console/views/modify_order.php
  79. +0 −14 php/console/views/modify_outboundmessage.php
  80. +0 −15 php/console/views/modify_prize.php
  81. +0 −14 php/console/views/modify_story.php
  82. +0 −14 php/console/views/modify_test.php
  83. +0 −14 php/console/views/modify_video.php
  84. +0 −14 php/console/views/modify_widget.php
  85. +0 −13 php/console/views/new_challenge.php
  86. +0 −13 php/console/views/new_comment.php
  87. +0 −13 php/console/views/new_completed_challenge.php
  88. +0 −13 php/console/views/new_member.php
  89. +0 −13 php/console/views/new_order.php
  90. +0 −13 php/console/views/new_outboundmessage.php
  91. +0 −13 php/console/views/new_prize.php
  92. +0 −13 php/console/views/new_story.php
  93. +0 −13 php/console/views/new_test.php
  94. +0 −13 php/console/views/new_video.php
  95. +0 −13 php/console/views/new_widget.php
  96. +0 −74 php/console/views/order_fields.php
  97. +0 −55 php/console/views/orders.php
  98. +0 −59 php/console/views/outboundmessage_fields.php
  99. +0 −45 php/console/views/outboundmessages.php
  100. +0 −25 php/console/views/place_widget.php
  101. +0 −104 php/console/views/prize_fields.php
  102. +0 −60 php/console/views/prizes.php
  103. +0 −10 php/console/views/send_outboundmessage.php
  104. +0 −52 php/console/views/story_fields.php
  105. +0 −36 php/console/views/story_posts.php
  106. +0 −19 php/console/views/test_fields.php
  107. +0 −8 php/console/views/video_fields.php
  108. +0 −31 php/console/views/video_posts.php
  109. +0 −36 php/console/views/view_challenge.php
  110. +0 −33 php/console/views/view_comment.php
  111. +0 −129 php/console/views/view_completed_challenge.php
  112. +0 −95 php/console/views/view_member.php
  113. +0 −21 php/console/views/view_member_email.php
  114. +0 −30 php/console/views/view_order.php
  115. +0 −54 php/console/views/view_outboundmessage.php
  116. +0 −42 php/console/views/view_prize.php
  117. +0 −46 php/console/views/view_story.php
  118. +0 −23 php/console/views/view_test.php
  119. +0 −19 php/console/views/view_video.php
  120. +0 −37 php/console/views/view_widget.php
  121. +0 −55 php/console/views/widget_fields.php
  122. +0 −30 php/console/views/widgets.php
  123. +2 −0 php/index.php
  124. +1 −1 php/scripts/statistics.js
  125. +5 −2 readme
  126. +12 −8 sites/climate/constants.php
  127. +4 −4 sites/climate/facebook/templates/bookmarklet.php
  128. +1 −1 sites/climate/facebook/templates/designHome.html
  129. +1 −1 sites/climate/facebook/templates/designParts.html
  130. +6 −6 sites/climate/facebook/templates/designProfileBox2.html
  131. +5 −5 sites/climate/facebook/templates/designRead.html
  132. +1 −1 sites/climate/facebook/templates/designTeam.html
  133. +1 −1 sites/climate/facebook/templates/designTeamFix.html
  134. +1 −1 sites/climate/facebook/templates/footer.php
  135. +9 −7 sites/minn/constants.php
  136. +44 −44 sites/minn/facebook/styles/default.css
  137. +4 −4 sites/minn/facebook/templates/bookmarklet.php
  138. +1 −1 sites/minn/facebook/templates/designBlocks.html
  139. +1 −1 sites/minn/facebook/templates/designChallenges.html
  140. +1 −1 sites/minn/facebook/templates/designHome.html
  141. +1 −1 sites/minn/facebook/templates/designParts.html
  142. +6 −6 sites/minn/facebook/templates/designProfileBox2.html
  143. +5 −5 sites/minn/facebook/templates/designRead.html
  144. +1 −1 sites/minn/facebook/templates/designResources.html
  145. +1 −1 sites/minn/facebook/templates/designTeam.html
  146. +1 −1 sites/minn/facebook/templates/designTeam2.html
  147. +1 −1 sites/minn/facebook/templates/designTeamFix.html
  148. +1 −1 sites/minn/facebook/templates/footer.php
@@ -1 +1 @@
-<?php// AdCode is the client advertising code that are placed on the siterequire_once(PATH_CORE .'/classes/dbRowObject.class.php');class AdCode extends dbRowObject{ }class AdCodeTable{ /////////////////////////////////////////////////////////////////////////////////////////////////////// // standard table fields var $db; static $tablename="AdCode"; static $idname = "id"; static $idtype = "INT(11) unsigned NOT NULL auto_increment"; static $dbRowObjectClass = "AdCodeRow"; static $fields = array( "site" => "varchar(50) default ''", "clientid" => "INT(11) default 0", "format" => "varchar(50) default ''", "locale" => "varchar(100) default ''", "code" => "TEXT default ''", "codeType" => "ENUM('html','iframe') default 'iframe'", "impRemaining" => "BIGINT(20) default 0", // remaining impressions "status" => "ENUM('active','completed','pending') default 'pending'" ); static $keydefinitions = array(); /* formats - 234 x 60 halfBanner 200 x 200 smallSquare 336 x 280 largeRect 300 x 250 mediumRect 468 x 60 smallBanner 728 x 90 largeBanner 160 x 600 tallSidebar locales - homeLargeBanner homeSmallBanner homeSidebar anySmallBanner anySidebar anyLargeRect anySidebarBottom */ /////////////////////////////////////////////////////////////////////////////////////////////////////// // standard table functions function __construct(&$db=NULL) { if (is_null($db)) { require_once('db.class.php'); $this->db=new cloudDatabase(); } else $this->db=$db; } // although many functions will be duplicated between table subclasses, having a parent class gets too messy function getRowObject() { $classname = self::$dbRowObjectClass; return new $classname($this->db, self::$tablename, array_keys(self::$fields), self::$idname); } // generic table creation routine, same for all *Table classes static function createTable($manageObj) { $manageObj->addTable(self::$tablename,self::$idname,self::$idtype,"MyISAM"); foreach (array_keys(self::$fields) as $key) { $manageObj->updateAddColumn(self::$tablename,$key,self::$fields[$key]); } foreach (self::$keydefinitions as $keydef) { $manageObj->updateAddKey(self::$tablename,$keydef[0], $keydef[1], $keydef[2], $keydef[3]); } } function fetch($locale='') { switch ($locale) { case 'homeLargeBanner': $format='largeBanner'; break; case 'homeSmallBanner': $format='smallBanner'; break; case 'homeSidebar': $format='smallSquare,halfBanner'; break; case 'anyLargeBanner': $format='largeBanner'; break; case 'anySmallBanner': $format='smallBanner'; break; case 'anySidebar': $format='smallSquare,halfBanner'; //$format=(RAND(0,1)==0? 'smallSquare' :'halfBanner'); break; case 'anySidebarBottom': $format='tallSidebar'; break; case 'anyLargeRect': $format='largeRect'; break; } $q=$this->db->query("SELECT * FROM AdCode WHERE locale LIKE '%".$locale."%' AND FIND_IN_SET(format,'$format') ORDER BY RAND() LIMIT 1;"); $ad=$this->db->readQ($q); return $ad->code; } function placeDefaultAds() {/* $q=$db->query("SELECT * FROM AdCode;"); if ($db->countQ($q)==0) { $manageObj->db->insert("AdCode","site,size,clientid,code,format,locale,","'largeBanner','google','".addslashes('<script type="text/javascript"><!--google_ad_client = "pub-9975156792632579";google_alternate_ad_url = "http://www.newscloud.com/static/ads/index.php?mode=html&size=banner&site=default&exclude=google";google_ad_width = 728;google_ad_height = 90;google_ad_format = "728x90_as";google_ad_type = "image";//2007-05-12: nc_bannergoogle_ad_channel = "4088172800";google_color_border = "000000";google_color_bg = "F0F0F0";google_color_link = "0000FF";google_color_text = "000000";google_color_url = "008000";//--></script><script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>')."'"); $manageObj->db->insert("AdCode","size,src,code","'largeBanner','amazon','".addslashes('<script type="text/javascript"><!-- amazon_ad_tag = "newscloud_banner-20"; amazon_ad_width = "728"; amazon_ad_height = "90"; amazon_ad_logo = "hide"; amazon_ad_exclude = ""; amazon_ad_include = ""; amazon_ad_link_target = "new"; //--></script><script type="text/javascript" src="http://www.assoc-amazon.com/s/ads.js"></script>')."'"); */ } /////////////////////////////////////////////////////////////////////////////////////////////////////// }?>
+<?php// AdCode is the client advertising code that are placed on the siterequire_once(PATH_CORE .'/classes/dbRowObject.class.php');class AdCode extends dbRowObject{ }class AdCodeTable{ /////////////////////////////////////////////////////////////////////////////////////////////////////// // standard table fields var $db; static $tablename="AdCode"; static $idname = "id"; static $idtype = "INT(11) unsigned NOT NULL auto_increment"; static $dbRowObjectClass = "AdCode"; static $fields = array( "site" => "varchar(50) default ''", "clientid" => "INT(11) default 0", "format" => "varchar(50) default ''", "locale" => "varchar(100) default ''", "code" => "TEXT default ''", "codeType" => "ENUM('html','iframe') default 'iframe'", "impRemaining" => "BIGINT(20) default 0", // remaining impressions "status" => "ENUM('active','completed','pending') default 'pending'" ); static $keydefinitions = array(); /* formats - 234 x 60 halfBanner 200 x 200 smallSquare 336 x 280 largeRect 300 x 250 mediumRect 468 x 60 smallBanner 728 x 90 largeBanner 160 x 600 tallSidebar locales - homeLargeBanner homeSmallBanner homeSidebar anySmallBanner anySidebar anyLargeRect anySidebarBottom */ /////////////////////////////////////////////////////////////////////////////////////////////////////// // standard table functions function __construct(&$db=NULL) { if (is_null($db)) { require_once('db.class.php'); $this->db=new cloudDatabase(); } else $this->db=$db; } // although many functions will be duplicated between table subclasses, having a parent class gets too messy function getRowObject() { $classname = self::$dbRowObjectClass; return new $classname($this->db, self::$tablename, array_keys(self::$fields), self::$idname); } // generic table creation routine, same for all *Table classes static function createTable($manageObj) { $manageObj->addTable(self::$tablename,self::$idname,self::$idtype,"MyISAM"); foreach (array_keys(self::$fields) as $key) { $manageObj->updateAddColumn(self::$tablename,$key,self::$fields[$key]); } foreach (self::$keydefinitions as $keydef) { $manageObj->updateAddKey(self::$tablename,$keydef[0], $keydef[1], $keydef[2], $keydef[3]); } } function fetch($locale='') { switch ($locale) { case 'homeLargeBanner': $format='largeBanner'; break; case 'homeSmallBanner': $format='smallBanner'; break; case 'homeSidebar': $format='smallSquare,halfBanner'; break; case 'anyLargeBanner': $format='largeBanner'; break; case 'anySmallBanner': $format='smallBanner'; break; case 'anySidebar': $format='smallSquare,halfBanner'; //$format=(RAND(0,1)==0? 'smallSquare' :'halfBanner'); break; case 'anySidebarBottom': $format='tallSidebar'; break; case 'anyLargeRect': $format='largeRect'; break; } $q=$this->db->query("SELECT * FROM AdCode WHERE locale LIKE '%".$locale."%' AND FIND_IN_SET(format,'$format') ORDER BY RAND() LIMIT 1;"); $ad=$this->db->readQ($q); return $ad->code; } function placeDefaultAds() {/* $q=$db->query("SELECT * FROM AdCode;"); if ($db->countQ($q)==0) { $manageObj->db->insert("AdCode","site,size,clientid,code,format,locale,","'largeBanner','google','".addslashes('<script type="text/javascript"><!--google_ad_client = "pub-9975156792632579";google_alternate_ad_url = "http://www.newscloud.com/static/ads/index.php?mode=html&size=banner&site=default&exclude=google";google_ad_width = 728;google_ad_height = 90;google_ad_format = "728x90_as";google_ad_type = "image";//2007-05-12: nc_bannergoogle_ad_channel = "4088172800";google_color_border = "000000";google_color_bg = "F0F0F0";google_color_link = "0000FF";google_color_text = "000000";google_color_url = "008000";//--></script><script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>')."'"); $manageObj->db->insert("AdCode","size,src,code","'largeBanner','amazon','".addslashes('<script type="text/javascript"><!-- amazon_ad_tag = "newscloud_banner-20"; amazon_ad_width = "728"; amazon_ad_height = "90"; amazon_ad_logo = "hide"; amazon_ad_exclude = ""; amazon_ad_include = ""; amazon_ad_link_target = "new"; //--></script><script type="text/javascript" src="http://www.assoc-amazon.com/s/ads.js"></script>')."'"); */ } /////////////////////////////////////////////////////////////////////////////////////////////////////// }?>
@@ -172,7 +172,6 @@ function populateCommonChallenges()
array("automatic","optInSMS","Receive SMS updates from ".SITE_TITLE."","Receive announcements and feature updates via SMS (aka text messages). Click on \"Settings\" and then \"Would you like to receive sms notifications from us through facebook? (50 pts)\" and follow the instructions.","0","0","50","1","1","0","enabled"),
array("automatic","levelIncrease","Level up!","As you accumulate points, your User Level increases. When you reach a new level, we give you bonus points!","0","0","200","6","6","0","enabled"),
array("automatic","referReader","Reader referral","Earn points when someone reads a story you shared!","0","0","5","300","10","0","enabled"),
- array("automatic","betaTest","Beta Test ".SITE_TITLE."","This special challenge is awarded only to the beta-testers of ".SITE_TITLE.".","0","0","250","1","1","0","disabled"),
array("automatic","chatStory","Chat about a story in ".SITE_TITLE."","Strike up a conversation about a story with one of your Facebook friends using the chat widget on the story page sidebar. This is a great way to introduce friends to climate change issues! Fine print: Your friend must click through to read the story. If they are not ".SITE_TITLE." members, they will be required to authorize the application for you to receive credit.","0","0","25","1000","10","0","enabled"),
array("submission","addAppTab","Add App Tab to profile","Add the ".SITE_TITLE." application tab to your Facebook profile so your friends can see what you've been up to. See <a href=\"".URL_CANVAS."?p=faq\">the FAQ</a> for details. Then send us a screenshot of the tab on your profile! File size must be under 2mb. (Don't know how to take a screenshot? Once again, <a href=\"".URL_CANVAS."?p=faq\">hit up the FAQ</a>.)","0","0","100","1","0","0","disabled"),
@@ -181,6 +180,7 @@ function populateCommonChallenges()
array("submission","blog","Blog about ".SITE_TITLE."","Forget blogging about what you had for lunch. We know you love ".SITE_TITLE." -- so why not write a post about it on your blog and send us the link?","0","0","75","25","1","0","disabled"),
);
+// array("automatic","betaTest","Beta Test ".SITE_TITLE."","This special challenge is awarded only to the beta-testers of ".SITE_TITLE.".","0","0","250","1","1","0","disabled"),
echo "Populating common challenges if missing...<br />";
foreach ($challenges as $cfields)
@@ -205,7 +205,7 @@ function notifyOthers($comment,$story,&$app=NULL) {
$siteContentId=$comment['siteContentId'];
$storyPoster=$story->userid;
//$ignoreLink="http://www.newscloud.com/ver/igCom/{safeEmail}/{actCode}/".$commentid;
- $profileLink='<a href="'.URL_CANVAS.'?p=account&o=settings">Stop comment notifications?</a>';
+ $profileLink='<a href="'.URL_CANVAS.'?p=account&o=subscribe">Change notifications?</a>';
$storyLink='<a href="'.URL_CANVAS.'?p=read&cid='.$siteContentId.'&nc">'.$story->title.'</a>'; // nc for no cache
$app->loadFacebookLibrary();
// check that commenter is not the poster
@@ -38,7 +38,8 @@ class ContentTable
"isBlocked" => "TINYINT(1) default 0",
"videoid" => "INT(11) default 0",
"widgetid" => "INT(11) default 0",
- "isBlogEntry" => "TINYINT(1) default 0"
+ "isBlogEntry" => "TINYINT(1) default 0",
+ "isFeatureCandidate" => "TINYINT(1) default 0"
);
static $keydefinitions = array();
@@ -140,7 +141,7 @@ function createStoryContent($userinfo=NULL,$info=NULL,$mode='link') {
$isBlogEntry=0;
else
$isBlogEntry=1;
- $story=$this->serialize(0,$info->title,$info->caption,$info->source,$info->url,$info->permalink,$userinfo->ncUid,$userinfo->u->name,$userinfo->userid,'',$userinfo->votePower,0,0,$info->imageUrl,0,$isBlogEntry);
+ $story=$this->serialize(0,$info->title,$info->caption,$info->source,$info->url,$info->permalink,$userinfo->ncUid,$userinfo->u->name,$userinfo->userid,'',$userinfo->votePower,0,0,$info->imageUrl,0,$isBlogEntry,$info->isFeatureCandidate);
// post wire story to content
$siteContentId=$this->add($story);
if ($info->videoEmbed<>'') {
@@ -188,8 +189,8 @@ function add($story) {
$chkDup=$this->db->queryC("SELECT siteContentId FROM Content WHERE permalink='$story->permalink';");
if (!$chkDup) {
// insert the story into the table
- $this_query=$this->db->insert("Content","contentid,title,caption,source,url,permalink,postedById,PostedByName,userid,date,score,isFeatured,imageid,videoid,isBlogEntry",
- "$story->contentid,'$story->title','$story->caption','$story->source','$story->url','$story->permalink',$story->postedById,'$story->postedByName',$story->userid,'$story->date',$story->score,$story->isFeatured,$story->imageid,$story->videoid,$story->isBlogEntry");
+ $this_query=$this->db->insert("Content","contentid,title,caption,source,url,permalink,postedById,PostedByName,userid,date,score,isFeatured,imageid,videoid,isBlogEntry,isFeatureCandidate",
+ "$story->contentid,'$story->title','$story->caption','$story->source','$story->url','$story->permalink',$story->postedById,'$story->postedByName',$story->userid,'$story->date',$story->score,$story->isFeatured,$story->imageid,$story->videoid,$story->isBlogEntry,$story->isFeatureCandidate");
$q=$this->db->query("SELECT siteContentId FROM Content WHERE url='$story->url' AND permalink='$story->permalink';");
$data=$this->db->readQ($q);
$contentImageQuery = $this->db->insert("ContentImages", "url, siteContentId, date", "'$story->imageUrl', $data->siteContentId, NOW()");
@@ -226,7 +227,7 @@ function updateCommentCount($siteContentId) {
$this->db->update("Content","numComments=numComments+1","siteContentId=$siteContentId");
}
- function serialize($contentid=0,$title='',$caption='',$source='',$url='',$permalink='',$postedById=0,$postedByName='',$userid=0,$date='',$score=0,$isFeatured=0,$imageid=0, $imageUrl='',$videoid=0,$isBlogEntry=0) {
+ function serialize($contentid=0,$title='',$caption='',$source='',$url='',$permalink='',$postedById=0,$postedByName='',$userid=0,$date='',$score=0,$isFeatured=0,$imageid=0, $imageUrl='',$videoid=0,$isBlogEntry=0,$isFeatureCandidate=0) {
// creates an object for an action
$data= new stdClass;
$data->contentid = $contentid;
@@ -247,6 +248,7 @@ function serialize($contentid=0,$title='',$caption='',$source='',$url='',$permal
$data->imageid=$imageid;
$data->videoid=$videoid;
$data->isBlogEntry=$isBlogEntry;
+ $data->isFeatureCandidate=$isFeatureCandidate;
if (!is_numeric($data->score)) $data->score=1;
if (!is_numeric($data->postedById)) $data->postedById=0;
return $data;
Oops, something went wrong.

0 comments on commit 0eb47e5

Please sign in to comment.