Skip to content
Browse files

updated January 2009 release

  • Loading branch information...
1 parent f29e5a0 commit bb988d49d96911c97c68f96ab45395580c8f610e Jeff Reifman committed
View
5 core/classes/content.class.php
@@ -193,9 +193,12 @@ function add($story) {
"$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);
+ // every story gets a contentimage entry
$contentImageQuery = $this->db->insert("ContentImages", "url, siteContentId, date", "'$story->imageUrl', $data->siteContentId, NOW()");
$imageid=$this->db->getId();
- $this->db->update("Content","imageid=$imageid","siteContentId=$data->siteContentId");
+ // only set imageid in Content table if there is actually an image
+ if ($story->imageUrl<>'')
+ $this->db->update("Content","imageid=$imageid","siteContentId=$data->siteContentId");
} else {
$data=$this->db->readQ($chkDup);
}
View
1 facebook/images/scaleImage.php
@@ -22,6 +22,7 @@
$data=$db->readQ($q);
// else create a new scaled image
$file_orig=$data->url; // old PATH_CACHE.'/story_'.$imageid.'.jpg';
+ if ($file_orig=='') $file_orig=PATH_SITE_IMAGES.'watermark.jpg';
$srcImage = imagecreatefromjpeg($file_orig);
list($srcWidth, $srcHeight) = getimagesize($file_orig);
$srcWidth>$srcHeight?$layout='landscape':$layout='portrait';
View
110 facebook/styles/default.css
@@ -1,6 +1,6 @@
/*
-Author: Adam Faja for Geoffco
-URL: http://www.geoffco.com
+Author: Adam Faja for Eye Level
+URL: http://www.youreyelevel.com
Test compress
CONTENTS
@@ -180,7 +180,7 @@ blockquote .quotes {
display: list-item;
margin: 0 0 10px 20px;
padding: 0;
- list-style-image: url(http://host.newscloud.com/sites/climate/facebook/index.php?p=cache&img=bullet1.gif);
+ list-style-image: url({URL_BASE}/index.php?p=cache&img=bullet1.gif);
list-style-type: disc;
list-style-position: outside;
border: none;
@@ -211,7 +211,7 @@ hr { border: none 0;
width: 760px;
height: 78px;
display: inline-block;
- background: url(http://host.newscloud.com/sites/climate/facebook/index.php?p=cache&img=bg_banner.jpg) top left no-repeat;
+ background: url({URL_BASE}/index.php?p=cache&img=bg_banner.jpg) top left no-repeat;
margin: 0;
}
@@ -241,7 +241,7 @@ hr { border: none 0;
width: 740px;
padding: 5px 10px;
margin-bottom: 2px;
- background: url(http://host.newscloud.com/sites/climate/facebook/index.php?p=cache&img=grad_bar_light.png) top repeat-x #aed0da;
+ background: url({URL_BASE}/index.php?p=cache&img=grad_bar_light.png) top repeat-x #aed0da;
}
@@ -310,22 +310,22 @@ a.powered:hover {
*********************************/
.rss_link {
- background: url(http://host.newscloud.com/sites/climate/facebook/index.php?p=cache&img=icon_rss.png) left no-repeat;
+ background: url({URL_BASE}/index.php?p=cache&img=icon_rss.png) left no-repeat;
padding: 3px 0 3px 18px;
}
.twitter_link {
- background: url(http://host.newscloud.com/sites/climate/facebook/index.php?p=cache&img=icon_twitter.gif) left no-repeat;
+ background: url({URL_BASE}/index.php?p=cache&img=icon_twitter.gif) left no-repeat;
padding: 3px 0 3px 18px;
}
.newscloud_link {
- background: url(http://host.newscloud.com/sites/climate/facebook/index.php?p=cache&img=icon_newscloud.gif) left no-repeat;
+ background: url({URL_BASE}/index.php?p=cache&img=icon_newscloud.gif) left no-repeat;
padding: 3px 0 3px 20px;
}
.grist_link {
- background: url(http://host.newscloud.com/sites/climate/facebook/index.php?p=cache&img=icon_grist.gif) left no-repeat;
+ background: url({URL_BASE}/index.php?p=cache&img=icon_grist.gif) left no-repeat;
padding: 3px 0 3px 20px;
}
@@ -404,7 +404,7 @@ a.powered:hover {
font-weight: bold;
font-size: 12px;
line-height: normal;
- background: url(http://host.newscloud.com/sites/climate/facebook/index.php?p=cache&img=grad_bar_dark.png) top repeat-x #1d7195;
+ background: url({URL_BASE}/index.php?p=cache&img=grad_bar_dark.png) top repeat-x #1d7195;
display: inline; }
.ie6 .toggle_tabs li a, .ie7 .toggle_tabs li a {display:inline-block;}
@@ -472,7 +472,7 @@ a.powered:hover {
color: #fff;
font-weight: bold;
font-size: 11px;
- background: url(http://host.newscloud.com/sites/climate/facebook/index.php?p=cache&img=grad_bar_dark.png) top repeat-x #1d7195;
+ background: url({URL_BASE}/index.php?p=cache&img=grad_bar_dark.png) top repeat-x #1d7195;
display: inline; }
#subNav .toggle_tabs li a.selected {
@@ -521,17 +521,17 @@ a.powered:hover {
margin-left: 0;}
#attachTabs .toggle_tabs li a.selected.photo_link {
- background: url(http://host.newscloud.com/sites/climate/facebook/index.php?p=cache&img=icon_photo.gif) 4px no-repeat #fff;}
+ background: url({URL_BASE}/index.php?p=cache&img=icon_photo.gif) 4px no-repeat #fff;}
#attachTabs .toggle_tabs li a.photo_link {
- background: url(http://host.newscloud.com/sites/climate/facebook/index.php?p=cache&img=icon_photo.gif) 4px no-repeat;
+ background: url({URL_BASE}/index.php?p=cache&img=icon_photo.gif) 4px no-repeat;
}
#attachTabs .toggle_tabs li a.selected.video_link {
- background: url(http://host.newscloud.com/sites/climate/facebook/index.php?p=cache&img=icon_video.gif) 4px no-repeat #fff;}
+ background: url({URL_BASE}/index.php?p=cache&img=icon_video.gif) 4px no-repeat #fff;}
#attachTabs .toggle_tabs li a.video_link {
- background: url(http://host.newscloud.com/sites/climate/facebook/index.php?p=cache&img=icon_video.gif) 4px no-repeat;
+ background: url({URL_BASE}/index.php?p=cache&img=icon_video.gif) 4px no-repeat;
}
#attachTabs .toggle_tabs li a.selected:hover { text-decoration:none;}
@@ -551,7 +551,7 @@ a.powered:hover {
#featurePanel {
padding: 0px 0px 10px 0px;
- background: url(http://host.newscloud.com/sites/climate/facebook/index.php?p=cache&img=grad_bg_light.png) bottom repeat-x #ebf6fc;
+ background: url({URL_BASE}/index.php?p=cache&img=grad_bg_light.png) bottom repeat-x #ebf6fc;
margin-bottom: 15px;
}
@@ -577,7 +577,7 @@ a.powered:hover {
}
#featurePanel .panelBar {
- background: url(http://host.newscloud.com/sites/climate/facebook/index.php?p=cache&img=grad_bar_light.png) top repeat-x #aed0da;
+ background: url({URL_BASE}/index.php?p=cache&img=grad_bar_light.png) top repeat-x #aed0da;
}
#featurePanel .thumb {
@@ -743,7 +743,7 @@ a.powered:hover {
#introPanel {
padding: 10px 10px 3px 10px;
margin: 0 0 5px 0;
- background: url(http://host.newscloud.com/sites/climate/facebook/index.php?p=cache&img=grad_bg_dark.png) top repeat-x #1d7195;
+ background: url({URL_BASE}/index.php?p=cache&img=grad_bg_dark.png) top repeat-x #1d7195;
}
#introPanel p { color: #fff; }
@@ -755,7 +755,7 @@ a.powered:hover {
margin: 0 0 15px 0;
overflow: auto;
display: inline-block;
- background: url(http://host.newscloud.com/sites/climate/facebook/index.php?p=cache&img=grad_bg_light.png) bottom repeat-x #ebf6fc;
+ background: url({URL_BASE}/index.php?p=cache&img=grad_bg_light.png) bottom repeat-x #ebf6fc;
}
#teamPanel h1 {
@@ -792,7 +792,7 @@ a.powered:hover {
padding: 0;
margin: 0;
display: inline-block;
- background: url(http://host.newscloud.com/sites/climate/facebook/index.php?p=cache&img=grad_bg_light.png) bottom repeat-x #ebf6fc;
+ background: url({URL_BASE}/index.php?p=cache&img=grad_bg_light.png) bottom repeat-x #ebf6fc;
}
#rewardsHead .storyBlockWrap {
@@ -854,7 +854,7 @@ a.powered:hover {
#teamIcon {
padding: 10px;
- background: url(http://host.newscloud.com/sites/climate/facebook/index.php?p=cache&img=bg_team.gif) top right no-repeat;
+ background: url({URL_BASE}/index.php?p=cache&img=bg_team.gif) top right no-repeat;
overflow: auto;
}
@@ -874,48 +874,48 @@ a.powered:hover {
font-size: 9px;
padding: 1px 2px;
color: #cc99cc;
- background: url(http://host.newscloud.com/sites/climate/facebook/index.php?p=cache&img=user_reader.gif) center repeat-x; }
+ background: url({URL_BASE}/index.php?p=cache&img=user_reader.gif) center repeat-x; }
.userLevel1 {
font-weight: normal;
font-size: 9px;
padding: 1px 2px;
color: #cb4d01;
- background: url(http://host.newscloud.com/sites/climate/facebook/index.php?p=cache&img=user_contributor.gif) center repeat-x; }
+ background: url({URL_BASE}/index.php?p=cache&img=user_contributor.gif) center repeat-x; }
.userLevel2 {
font-weight: normal;
font-size: 9px;
padding: 1px 2px;
color: #996633;
- background: url(http://host.newscloud.com/sites/climate/facebook/index.php?p=cache&img=user_bronze.gif) center repeat-x; }
+ background: url({URL_BASE}/index.php?p=cache&img=user_bronze.gif) center repeat-x; }
.userLevel3 {
font-weight: normal;
font-size: 9px;
padding: 1px 2px;
color: #999999;
- background: url(http://host.newscloud.com/sites/climate/facebook/index.php?p=cache&img=user_silver.gif) center repeat-x; }
+ background: url({URL_BASE}/index.php?p=cache&img=user_silver.gif) center repeat-x; }
.userLevel4 {
font-weight: normal;
font-size: 9px;
padding: 1px 2px;
color: #cc9900;
- background: url(http://host.newscloud.com/sites/climate/facebook/index.php?p=cache&img=user_gold.gif) center repeat-x; }
+ background: url({URL_BASE}/index.php?p=cache&img=user_gold.gif) center repeat-x; }
.userLevel5 {
font-weight: normal;
font-size: 9px;
padding: 1px 2px;
color: #80aac0;
- background: url(http://host.newscloud.com/sites/climate/facebook/index.php?p=cache&img=user_platinum.gif) center repeat-x; }
+ background: url({URL_BASE}/index.php?p=cache&img=user_platinum.gif) center repeat-x; }
#actionLegend {
padding: 10px;
margin: 0 0 15px 0;
- background: url(http://host.newscloud.com/sites/climate/facebook/index.php?p=cache&img=grad_bg_orange.png) repeat-x bottom;
+ background: url({URL_BASE}/index.php?p=cache&img=grad_bg_orange.png) repeat-x bottom;
}
#actionLegend .btn_1 { margin: 0 0 10px 20px; float: right; }
@@ -926,7 +926,7 @@ a.powered:hover {
padding: 0;
margin: 0 0 15px 0;
display: inline-block;
- background: url(http://host.newscloud.com/sites/climate/facebook/index.php?p=cache&img=grad_bg_light.png) bottom repeat-x #ebf6fc;
+ background: url({URL_BASE}/index.php?p=cache&img=grad_bg_light.png) bottom repeat-x #ebf6fc;
}
#wideTipPanel .wideTipLeft {
@@ -974,11 +974,11 @@ These wrappers cascade to tell .panelBar to which background to use for the titl
}
.panel_1 .panelBar {
- background: url(http://host.newscloud.com/sites/climate/facebook/index.php?p=cache&img=grad_bar_light.png) top repeat-x #AED0DA;
+ background: url({URL_BASE}/index.php?p=cache&img=grad_bar_light.png) top repeat-x #AED0DA;
}
.panel_2 .panelBar {
- background: url(http://host.newscloud.com/sites/climate/facebook/index.php?p=cache&img=grad_bar_orange.png) top repeat-x #cb4d01;
+ background: url({URL_BASE}/index.php?p=cache&img=grad_bar_orange.png) top repeat-x #cb4d01;
}
.panelBar h2 {
@@ -1026,7 +1026,7 @@ These wrappers cascade to tell .panelBar to which background to use for the titl
-moz-border-radius: 4px;
-webkit-border-radius: 4px;
border-radius: 4px;
- background: #AED0DA url(http://host.newscloud.com/sites/climate/facebook/index.php?p=cache&img=grad_bar_light.png) repeat-x scroll center top;
+ background: #AED0DA url({URL_BASE}/index.php?p=cache&img=grad_bar_light.png) repeat-x scroll center top;
}
@@ -1041,7 +1041,7 @@ These wrappers cascade to tell .panelBar to which background to use for the titl
-moz-border-radius: 4px;
-webkit-border-radius: 4px;
border-radius: 4px;
- background: url(http://host.newscloud.com/sites/climate/facebook/index.php?p=cache&img=btn_1.png) top repeat-x #c14001;
+ background: url({URL_BASE}/index.php?p=cache&img=btn_1.png) top repeat-x #c14001;
}
.btn_1_lg {
@@ -1060,7 +1060,7 @@ These wrappers cascade to tell .panelBar to which background to use for the titl
-moz-border-radius: 4px;
-webkit-border-radius: 4px;
border-radius: 4px;
- background: url(http://host.newscloud.com/sites/climate/facebook/index.php?p=cache&img=btn_2.png) bottom repeat-x #cce4f0;
+ background: url({URL_BASE}/index.php?p=cache&img=btn_2.png) bottom repeat-x #cce4f0;
}
.btn_left {
@@ -1072,18 +1072,18 @@ These wrappers cascade to tell .panelBar to which background to use for the titl
-webkit-border-bottom-left-radius: 4px;
border-top-left-radius: 4px;
border-bottom-left-radius: 4px;
- background: url(http://host.newscloud.com/sites/climate/facebook/index.php?p=cache&img=btn_2.png) bottom repeat-x #cce4f0;
+ background: url({URL_BASE}/index.php?p=cache&img=btn_2.png) bottom repeat-x #cce4f0;
}
.voteLink {
- background: url(http://host.newscloud.com/sites/climate/facebook/index.php?p=cache&img=icon_vote.gif) left no-repeat;
+ background: url({URL_BASE}/index.php?p=cache&img=icon_vote.gif) left no-repeat;
padding-left: 15px;
}
.btn_mid {
margin: 0 1px;
padding: 3px 8px 4px 8px;
- background: url(http://host.newscloud.com/sites/climate/facebook/index.php?p=cache&img=btn_2.png) bottom repeat-x #cce4f0;
+ background: url({URL_BASE}/index.php?p=cache&img=btn_2.png) bottom repeat-x #cce4f0;
}
.btn_right {
@@ -1095,7 +1095,7 @@ These wrappers cascade to tell .panelBar to which background to use for the titl
-webkit-border-bottom-right-radius: 4px;
border-top-right-radius: 4px;
border-bottom-right-radius: 4px;
- background: url(http://host.newscloud.com/sites/climate/facebook/index.php?p=cache&img=btn_2.png) bottom repeat-x #cce4f0;
+ background: url({URL_BASE}/index.php?p=cache&img=btn_2.png) bottom repeat-x #cce4f0;
}
.rating {
@@ -1111,11 +1111,11 @@ These wrappers cascade to tell .panelBar to which background to use for the titl
width: 16px;
height: 16px;
margin: 0 0 0 10px;
- background: url(http://host.newscloud.com/sites/climate/facebook/index.php?p=cache&img=icon_thumbs.gif) top left no-repeat;
+ background: url({URL_BASE}/index.php?p=cache&img=icon_thumbs.gif) top left no-repeat;
}
.rate_up:hover {
- background: url(http://host.newscloud.com/sites/climate/facebook/index.php?p=cache&img=icon_thumbs.gif) center left no-repeat;
+ background: url({URL_BASE}/index.php?p=cache&img=icon_thumbs.gif) center left no-repeat;
}
.rate_up_on {
@@ -1124,7 +1124,7 @@ These wrappers cascade to tell .panelBar to which background to use for the titl
width: 16px;
height: 16px;
margin: 0 0 0 10px;
- background: url(http://host.newscloud.com/sites/climate/facebook/index.php?p=cache&img=icon_thumbs.gif) bottom left no-repeat;
+ background: url({URL_BASE}/index.php?p=cache&img=icon_thumbs.gif) bottom left no-repeat;
}
.rate_down {
@@ -1133,11 +1133,11 @@ These wrappers cascade to tell .panelBar to which background to use for the titl
width: 16px;
height: 16px;
margin: 0 10px 0 10px;
- background: url(http://host.newscloud.com/sites/climate/facebook/index.php?p=cache&img=icon_thumbs.gif) top right no-repeat;
+ background: url({URL_BASE}/index.php?p=cache&img=icon_thumbs.gif) top right no-repeat;
}
.rate_down:hover {
- background: url(http://host.newscloud.com/sites/climate/facebook/index.php?p=cache&img=icon_thumbs.gif) center right no-repeat;
+ background: url({URL_BASE}/index.php?p=cache&img=icon_thumbs.gif) center right no-repeat;
}
.rate_down_on {
@@ -1146,7 +1146,7 @@ These wrappers cascade to tell .panelBar to which background to use for the titl
width: 16px;
height: 16px;
margin: 0 10px 0 10px;
- background: url(http://host.newscloud.com/sites/climate/facebook/index.php?p=cache&img=icon_thumbs.gif) bottom right no-repeat;
+ background: url({URL_BASE}/index.php?p=cache&img=icon_thumbs.gif) bottom right no-repeat;
}
.flag {
@@ -1157,12 +1157,12 @@ These wrappers cascade to tell .panelBar to which background to use for the titl
margin: 0 0 0 10px;
border-left: 1px solid #ccc;
padding-left: 30px;
- background: url(http://host.newscloud.com/sites/climate/facebook/index.php?p=cache&img=icon_flag.gif) 10px top no-repeat;
+ background: url({URL_BASE}/index.php?p=cache&img=icon_flag.gif) 10px top no-repeat;
}
a.flag:hover {
color: #cc3333;
- background: url(http://host.newscloud.com/sites/climate/facebook/index.php?p=cache&img=icon_flag.gif) 10px center no-repeat;
+ background: url({URL_BASE}/index.php?p=cache&img=icon_flag.gif) 10px center no-repeat;
}
.flag_on {
@@ -1173,7 +1173,7 @@ a.flag:hover {
margin: 0 0 0 10px;
border-left: 1px solid #ccc;
padding-left: 30px;
- background: url(http://host.newscloud.com/sites/climate/facebook/index.php?p=cache&img=icon_flag.gif) 10px bottom no-repeat;
+ background: url({URL_BASE}/index.php?p=cache&img=icon_flag.gif) 10px bottom no-repeat;
}
@@ -1284,7 +1284,7 @@ li {
-moz-border-radius: 4px;
-webkit-border-radius: 4px;
border-radius: 4px;
- background: url(http://host.newscloud.com/sites/climate/facebook/index.php?p=cache&img=btn_2.png) bottom repeat-x #cce4f0;
+ background: url({URL_BASE}/index.php?p=cache&img=btn_2.png) bottom repeat-x #cce4f0;
}
.storyCommands td {
@@ -1307,7 +1307,7 @@ li {
.top_reward {
padding: 10px 10px 3px 10px;
margin: 0;
- background: url(http://host.newscloud.com/sites/climate/facebook/index.php?p=cache&img=grad_bg_orange.png) bottom repeat-x;
+ background: url({URL_BASE}/index.php?p=cache&img=grad_bg_orange.png) bottom repeat-x;
}
.top_reward .thumb {
@@ -1385,7 +1385,7 @@ li {
/* My Profile Summary */
#profileSummary {
- background: url(http://host.newscloud.com/sites/climate/facebook/index.php?p=cache&img=grad_bg_orange.png) bottom repeat-x;
+ background: url({URL_BASE}/index.php?p=cache&img=grad_bg_orange.png) bottom repeat-x;
}
#profileSummary .panel_block {
@@ -1424,7 +1424,7 @@ li {
#bookmarkletPanel {
padding: 10px 10px 3px 10px;
margin: 0 0 5px 0;
- background: url(http://host.newscloud.com/sites/climate/facebook/index.php?p=cache&img=grad_bg_dark.png) top repeat-x #1d7195;
+ background: url({URL_BASE}/index.php?p=cache&img=grad_bg_dark.png) top repeat-x #1d7195;
}
#bookmarkletPanel p, #bookmarkletPanel h2 {
@@ -1441,7 +1441,7 @@ li {
height: 26px;
padding: 70px 0 0 0;
margin: 15px 0 10px 0;
- background: url(http://host.newscloud.com/sites/climate/facebook/index.php?p=cache&img=bookmarklet_demo.gif) top left no-repeat;
+ background: url({URL_BASE}/index.php?p=cache&img=bookmarklet_demo.gif) top left no-repeat;
}
@@ -1488,7 +1488,7 @@ li {
margin: 0 0 10px 0;
padding: 0px 8px 3px 8px;
width: 170px;
- /*background: url(http://host.newscloud.com/sites/climate/facebook/index.php?p=cache&img=bg_bob2.gif) top right no-repeat #d8dfea;*/
+ /*background: url({URL_BASE}/index.php?p=cache&img=bg_bob2.gif) top right no-repeat #d8dfea;*/
}
.box_intro p {
font-size: 10px;
@@ -1575,7 +1575,7 @@ li {
display: list-item;
margin: 0 0 10px 40px;
padding: 0;
- list-style-image: url(http://host.newscloud.com/sites/climate/facebook/index.php?p=cache&img=bullet1.gif);
+ list-style-image: url({URL_BASE}/index.php?p=cache&img=bullet1.gif);
list-style-type: disc;
list-style-position: outside;
border: none;
@@ -1612,7 +1612,7 @@ li {
/*****************
13) FORMS
******************/
-.process {background: white url('http://host.newscloud.com/sites/climate/facebook/index.php?p=cache&img=vertical_bg_animation.gif') top left repeat;opacity: .5;}
+.process {background: white url('{URL_BASE}/index.php?p=cache&img=vertical_bg_animation.gif') top left repeat;opacity: .5;}
.attachment_stage{width:360px;}
.attachment_stage{border-top:1px solid #ccc;border-bottom:1px solid #ccc;background-color:#f0f0f0;}
.formErrorText {font-weight: bold;color: #cb4d01;}
View
62 php/config.php
@@ -176,26 +176,29 @@ function checkWarnings(&$db) {
}
}
+ // check for write access to cache directory for CSS, JS files
+ try {
+ $tempStr=' <p><span style="color:red;"><strong>WARNING:</strong></span>Caching problem with CSS stylesheets and Javascript files - could not open or write to '.PATH_CACHE.' - set ownership for Apache Web service e.g. chown www-user:www-user '.PATH_CACHE.' and set write permissions for the directory chmod -R 755 '.PATH_CACHE.'</p>';
+ $handle = fopen(PATH_CACHE.DS.'configTest.txt', "a");
+ if (!$handle)
+ $warnings.=$tempStr;
+ else {
+ $res=fwrite($handle,"config.php cache test");
+ if (!$res) $warnings.=$tempStr;
+ }
+ } catch (Exception $e) {
+ $warnings.=$tempStr;
+ }
+
if (defined('NO_SECURITY') AND NO_SECURITY) {
global $init;
$warnings.='<p><span style="color:red;"><strong>WARNING: Security is turned off</strong></span> Before you launch, be sure to turn security on in constants.php. <strong>Important</strong>: Bookmark <strong><a href="'.SITE_DOMAIN.'?p=config&apiKey='.$init['apiKey'].'">this link</a></strong> before you turn security on. After you turn security on, you can reach the management console from the Admin link in the footer of your Facebook application.</p>';
}
+
if (defined('NO_CACHE') AND NO_CACHE) {
- $warnings.='<p><span style="color:orange;"><strong>NOTICE: Caching is turned off</strong></span> When you are ready to launch, you can turn on caching in constants.php to enhance performance. You will need to permission the /sites/cache directory for Apache to write to.</p>';
- } else {
- try {
- $tempStr=' <p><span style="color:red;"><strong>WARNING:</strong></span> Caching problem - could not open or write to '.PATH_CACHE.' - set ownership for Apache Web service e.g. chown www-data:www-data '.PATH_CACHE.' and set write permissions for the directory chmod -R 755 '.PATH_CACHE.'</p>';
- $handle = fopen(PATH_CACHE.DS.'configTest.txt', "a");
- if (!$handle)
- $warnings.=$tempStr;
- else {
- $res=fwrite($handle,"config.php cache test");
- if (!$res) $warnings.=$tempStr;
- }
- } catch (Exception $e) {
- $warnings.=$tempStr;
- }
- }
+ $warnings.='<p><span style="color:orange;"><strong>NOTICE: Caching is turned off</strong></span> When you are ready to launch, you can turn on caching in constants.php to enhance performance. You will need to permission the '.PATH_CACHE.' directory for Apache to write to.</p>';
+ }
+
if (defined('NO_LOGGING') AND NO_LOGGING) {
$warnings.='<p><span style="color:orange;"><strong>NOTICE: Logging is turned off</strong></span> You can turn it on constants.php. You will need to touch and permission the specified /var/logs/*.log files for Apache to write to.</p>';
} else {
@@ -212,6 +215,35 @@ function checkWarnings(&$db) {
$warnings.=$tempStr;
}
}
+
+ // check for write access to uploaded file directories - PATH_UPLOAD_IMAGES
+ try {
+ $tempStr=' <p><span style="color:yellow;"><strong>Warning:</strong></span> Uploading user submissions - could not open or write to '.PATH_UPLOAD_IMAGES.' - set ownership for Apache Web service e.g. chown www-user:www-user '.PATH_UPLOAD_IMAGES.' and set write permissions for the directory chmod -R 755 '.PATH_UPLOAD_IMAGES.'</p>';
+ $handle = fopen(PATH_UPLOAD_IMAGES.'configTest.txt', "a");
+ if (!$handle)
+ $warnings.=$tempStr;
+ else {
+ $res=fwrite($handle,"config.php upload test");
+ if (!$res) $warnings.=$tempStr;
+ }
+ } catch (Exception $e) {
+ $warnings.=$tempStr;
+ }
+
+ // check for write access to uploaded file directories - PATH_UPLOAD_SUBMISSIONS
+ try {
+ $tempStr=' <p><span style="color:yellow;"><strong>Warning:</strong></span> Uploading user submissions - could not open or write to '.PATH_UPLOAD_SUBMISSIONS.' - set ownership for Apache Web service e.g. chown www-user:www-user '.PATH_UPLOAD_SUBMISSIONS.' and set write permissions for the directory chmod -R 755 '.PATH_UPLOAD_SUBMISSIONS.'</p>';
+ $handle = fopen(PATH_UPLOAD_SUBMISSIONS.'configTest.txt', "a");
+ if (!$handle)
+ $warnings.=$tempStr;
+ else {
+ $res=fwrite($handle,"config.php upload test");
+ if (!$res) $warnings.=$tempStr;
+ }
+ } catch (Exception $e) {
+ $warnings.=$tempStr;
+ }
+
return $warnings;
}
View
4 readme.txt
@@ -33,6 +33,10 @@ Please also follow us on twitter @newscloud: http://twitter.com/newscloud
Release Notes
---------------------------------------------
+v0.31 - Facebook PHP Open Source Releases Jan 6, 2009
+ * Updated documentation and sample settings to make configuration easier for more environments
+ * Patch release to v0.30
+
v0.30 - Facebook PHP Updated Dec 2009
* Updated to provide easier set up: /sites/default subdirectory added with sample installation files, see /setup.txt
* New features include ideas, answers, twitter rooms and photo streams
View
4 setup.txt
@@ -16,7 +16,7 @@ This program is free software: you can redistribute it and/or modify
along with this program. If not, see <http://www.gnu.org/licenses/>.
----------------------------------------
-Last modified: December 2009
+Last modified: January 6, 2009
* APACHE: Configure your website in Apache using /sites/default/apache_conf_sample as a guide
- e.g. we are using default.newsi.us in our example pages
@@ -25,7 +25,7 @@ Last modified: December 2009
* DATABASE: Create a database and set permissions
- e.g. CREATE DATABASE menagerie;
- - e.g. GRANT ALL ON menagerie.* TO 'your_mysql_name'@'your_client_host';
+ - e.g. GRANT ALL ON menagerie.* TO 'your_mysql_name'@'your_client_host' IDENTIFIED BY 'my-pass-word';
* FACEBOOK: Create a Facebook application
- Use the http://www.facebook.com/developers/ application to set up a new application. You just need to select a name at this time. Other settings will be uploaded during our installation process.
View
4 sites/default/cache/readme.txt
@@ -1 +1,3 @@
-Placeholder for caching directory
+This directory needs to be made writable and owned by your apache user
+chmod 755 /sites/default/cache
+chown www-user:www-user /sites/default/cache
View
114 sites/default/constants_sample.php
@@ -1,59 +1,65 @@
<?php
- // Copy this file to constants.php
- // Change settings to your particular site and configuration
+ /************************************************************************/
+ /* Copy this file to constants.php */
+ /* Change settings to your particular site and configuration */
+ /* Pay special attention to areas marked REQUIRED */
+ /************************************************************************/
- // IMPORTANT: be sure to change image paths to your server in /facebook/styles/default.css
+ // Model settings
+ define ("DS","/"); // directory separator
+ define ("MODULE_FACEBOOK",true);
+ define ("MODULE_ACTIVE","FACEBOOK");
+
+ // For installation and testing
+ // REQUIRED: remove these or set to false for launch
+ define ("NO_SECURITY",true); // remove to enable console security after configuration
+ define ("NO_LOGGING",true); // remove to enable logging, touch & permission PATH_LOGFILE files e.g. /var/log
+ define ("NO_CACHE",true); // remove to enable caching, touch & permission PATH_CACHE files e.g. /sites/default/cache
- // Site directory name e.g. if using /sites/default, set to 'default'
+ // REQUIRED: Site sub-directory name e.g. if using /sites/default, set to 'default'
define ("SITE_PATH_NAME",'default');
- define ("SITE_DOMAIN",'http://default.newsi.us');
- define ("URL_CANVAS","http://apps.facebook.com/defaultapp/"); // trailing slash matters to Facebook
+ define ("SITE_DOMAIN",'http://default.newsi.us'); // do not use trailing slash
+ define ("URL_CANVAS","http://apps.facebook.com/defaultapp/"); // requires trailing slash (due to Facebook)
define("URL_BASE",SITE_DOMAIN.'/facebook');
define ("URL_HOME",SITE_DOMAIN.'/php/');
-
- // For installation and testing - remove when done
- define ("NO_SECURITY",true); // remove to enable console security after configuration
- define ("NO_LOGGING",true); // remove to enable logging, must touch and permission /var/log files
- define ("NO_CACHE",true); // remove to enable caching, must touch and permission /sites/cache files
-
- // Model settings
- define ("DS","/"); // directory separator
- define ("MODULE_FACEBOOK",true);
- define ("MODULE_ACTIVE","FACEBOOK");
+ define ('SRC_ROOT',DS.'var'.DS.'www'.DS.'newscloud'); // e.g. root of the source code for NewsCloud
+ // IMPORTANT for SITE_DOMAIN setting
+ // The above basic configuration uses an Apache virtual host
+ // The DOCUMENT_ROOT setting in /sites/default/apache_conf_sample determines which subdirectory SITE_DOMAIN resolves
+ // If you use a virtual host, the DOCUMENT_ROOT or public web directory that SITE_DOMAIN points to should be WEBROOT/sites/default/ e.g. /var/www/sites/default or /var/www/newscloud/sites/default
+ // If you do not use a virtual host, SITE_DOMAIN needs to point to a full path to your sites directory
+ // e.g. define ("SITE_DOMAIN","http://yourdomain.com/sites/default");
+ // e.g. or define ("SITE_DOMAIN","http://yourdomain.com/newscloud/sites/default");
- // Secret key settings
+ // REQUIRED: Secret key settings
// You can either define your secret keys in the constants file
// - or - do as we do, for security, store them in an ini file outside of the apache web directory path
// a global $init array must exist for the database to be initialized properly
- define ("INI_FILE_FOR_SECRET_KEYS",true);
- if (INI_FILE_FOR_SECRET_KEYS) {
- // check for ini file existence
- define ("INI_PATH",DS.'var'.DS.'www'.DS.'grist'.DS); // hard coded for unification
- $init=parse_ini_file(INI_PATH.SITE_PATH_NAME.'.ini');
- } else {
- // otherwise, set up your $init settings here
+ define ("INI_FILE_FOR_SECRET_KEYS",false); // default is to define these in this file
+ if (!INI_FILE_FOR_SECRET_KEYS) {
+ // set up your $init settings here
$init['apiKey']='put-yourkeyhere'; // deprecated use random#-anystring e.g. 1223-asldjkwemx , 35 char max
$init['fbAnalytics']='your-google-analytics-key-for-facebook'; // get from http://google.com/analytics
$init['database']='your database Name';
$init['username']='your database user';
$init['password']='your database password';
$init['hostname']='your database hostname';
- if (MODULE_FACEBOOK) {
- // Get these from http://developers.facebook.com based on your application
- $init['fbAppId']='your facebook appid (numeric)';
- $init['fbAPIKey']='your facebook api key';
- $init['fbSecretKey']='your facebook secret key';
- }
+ $init['fbAppId']='your facebook appid (numeric)';
+ $init['fbAPIKey']='your facebook api key';
+ $init['fbSecretKey']='your facebook secret key';
+ // optional - only needed if using micro/twitter room, twitter posts
+ $init['twitterPwd'] = 'your twitter account password';
+ // optional - only needed if using recaptcha
+ $init['key_pri_recaptcha']='your recaptcha key';
+ } else {
+ // otherwise, check for ini file existence at path below
+ // can be more secure if you configure variables in .ini file outside of public web server directories
+ define ("INI_PATH",DS.'var'.DS); // hard coded for unification
+ $init=parse_ini_file(INI_PATH.SITE_PATH_NAME.'.ini');
}
- define ("USE_TWITTER",true);
- if (USE_TWITTER)
- define ("TWITTER_PWD",$init['twitterPwd']); // your twitter password from above INI file or set statically here
- define ("USE_RECAPTCHA",false);
- if (USE_RECAPTCHA)
- define ("KEY_PRI_RECAPTCHA",$init['key_pri_recaptcha']); // get from http://recaptcha.net
- // Site settings
- define ("SITE_TITLE",'Default Site Title');
+ // REQUIRED: Site settings
+ define ("SITE_TITLE",'Default Title'); // Maximum of 16 characters per Facebook
define ("SITE_TITLE_SHORT",SITE_PATH_NAME);
define ("CACHE_PREFIX",'dft'); // two or three letter prefix for your site title
define ("SITE_SPONSOR",'Default Corp.');
@@ -73,31 +79,36 @@
define ("TAB_STORIES","News");
// tags module
$crowdTags=array('education','health','music','technology','food','politics','transportation','lifestyle','arts','sports','business','gardening','travel','recreation','government','environment');
+ define ("USE_TWITTER",true);
+
+ if (USE_TWITTER)
+ define ("TWITTER_PWD",$init['twitterPwd']); // your twitter password from above INI file or set statically here
+ define ("USE_RECAPTCHA",false);
+ if (USE_RECAPTCHA)
+ define ("KEY_PRI_RECAPTCHA",$init['key_pri_recaptcha']); // get from http://recaptcha.net
/* URL Settings */
define ("URL_PREFIX",'/index.php');
define ("URL_CALLBACK",URL_BASE.URL_PREFIX);
define ("URL_RSS",URL_BASE."?p=rss"); // or burned RSS feed e.g. http://feeds2.feedburner.com/default
- define('URL_UPLOADS', URL_BASE.'/uploads');
- define('URL_THUMBNAILS', URL_UPLOADS.'/images');
- define('URL_SUBMITTED_IMAGES', URL_UPLOADS.'/submissions');
+ define('URL_UPLOADS', URL_BASE.'/uploads'); // make sure that web server can write to this directory and children
+ define('URL_THUMBNAILS', URL_UPLOADS.'/images');
+ define('URL_SUBMITTED_IMAGES', URL_UPLOADS.'/submissions');
define ("URL_CACHE",URL_HOME.'?p=cache');
define ("URL_CONSOLE",URL_HOME."?p=console");
- /* Directory path settings */
- define ("PATH_ROOT",$_SERVER['DOCUMENT_ROOT']);
- define ('SRC_ROOT',DS.'var'.DS.'www'.DS.'grist'.DS.'current');
- define ('SRC_SITE',DS.'sites'.DS.SITE_PATH_NAME);
+ /* Additional Directory path settings */
+ define ('SRC_SITE',DS.'sites'.DS.SITE_PATH_NAME);
define ('PATH_CORE',SRC_ROOT.DS.'core'.DS);
define ('PATH_CONSOLE',SRC_ROOT.DS.'php'.DS.'console');
- define ('PATH_SITE',PATH_ROOT.SRC_SITE.DS.'facebook');
+ define ('PATH_SITE',SRC_ROOT.SRC_SITE.DS.'facebook');
define ('PATH_FACEBOOK',SRC_ROOT.DS.'facebook');
- define ('PATH_CACHE',SRC_ROOT.DS.SRC_SITE.DS.'cache');
+ define ('PATH_CACHE',SRC_ROOT.SRC_SITE.DS.'cache');
define ('PATH_SITE_IMAGES', SRC_ROOT.SRC_SITE.DS.'facebook'.DS.'images'.DS);
define ('PATH_IMAGES',PATH_FACEBOOK.DS.'images'.DS);
define ('PATH_TEMPLATES',SRC_ROOT.SRC_SITE.DS.'facebook'.DS.'templates');
- define ('PATH_STYLES',SRC_ROOT.SRC_SITE.DS.'facebook'.DS.'styles'); // or, move to /smt/sites/climate/facebook/styles directory for site-specific approach
- define ('PATH_FACEBOOK_STYLES',SRC_ROOT.SRC_SITE.DS.'facebook'.DS.'styles'); // this has to have a shared name with constants.php
+ define ('PATH_STYLES',SRC_ROOT.SRC_SITE.DS.'facebook'.DS.'styles');
+ define ('PATH_FACEBOOK_STYLES',SRC_ROOT.SRC_SITE.DS.'facebook'.DS.'styles');
define ('PATH_SCRIPTS',SRC_ROOT.DS.'facebook'.DS.'scripts');
define('PATH_UPLOAD_IMAGES', SRC_ROOT.SRC_SITE.DS.'facebook'.DS.'uploads'.DS.'images'.DS);
define('PATH_UPLOAD_SUBMISSIONS', SRC_ROOT.SRC_SITE.DS.'facebook'.DS.'uploads'.DS.'submissions'.DS);
@@ -234,8 +245,5 @@
// DEPRECATED
define ("SITE_CLOUDID",1);
define ("RESEARCH_SITE_ID",1); // value definied in research.sites database
- // define ("USE_SIMPLEPIE",true); // fetch rss feeds locally
- // define ("URL_SMT_NODE","http://api.newscloud.com/services/cloud.php");
- // define ("URL_SMT_SERVER",URL_CANVAS);
- // define("ENABLE_RESEARCH_STUDY", true); // might not need to be global if all relevant logic is in account.php template and rules templates
+
?>

0 comments on commit bb988d4

Please sign in to comment.
Something went wrong with that request. Please try again.