$_custom_css = $_base_path . 'mods/wordpress/module.css'; // use a custom stylesheet\r
\r
require (AT_INCLUDE_PATH.'header.inc.php');\r
+$p = intval($_GET['p']);\r
+\r
\r
?>\r
\r
<a href="<?php echo $_config['wp-url']; ?>wp-login.php" target="toolframe">\r
<?php echo _AT('wordpress_login'); ?></a>\r
-<iframe name="toolframe" src="<?php echo $_config['wp-url']; ?><?php if($p !=''){ echo '?p='.$p;} ?>" width="95%" height="450" style="border:none;">\r
+<iframe name="toolframe" src="<?php echo $_config['wp-url']; ?><?php if($p !=''){ echo '?p='.$p;} ?>" width="95%" height="450" style="border:none;" id="randomid<?php srand(time()); ?>">\r
<p><?php echo _AT('wordpress_no_iframe',$_config['wp-url']); ?>"><?php echo _AT('wordpress_login'); ?></a></p>\r
</iframe>\r
<?php require (AT_INCLUDE_PATH.'footer.inc.php'); ?>\r
require (AT_INCLUDE_PATH.'vitals.inc.php');\r
$_custom_css = $_base_path . 'mods/wordpress/module.css'; // use a custom stylesheet\r
require (AT_INCLUDE_PATH.'header.inc.php');\r
-\r
+$p = intval($_GET['p']);\r
?>\r
\r
<a href="<?php echo $_config['wp-url']; ?>wp-login.php" target="toolframe">\r
INSERT INTO `language_text` VALUES ('en', '_module','wordpress_db_name','WordPress Database Name',NOW(),'');\r
INSERT INTO `language_text` VALUES ('en', '_module','wordpress_db_port','WordPress Database Port',NOW(),'');\r
INSERT INTO `language_text` VALUES ('en', '_module','wordpress_db_user','WordPress Database User',NOW(),'');\r
+INSERT INTO `language_text` VALUES ('en', '_module','wordpress_update','WordPress Update',NOW(),'');\r
INSERT INTO `language_text` VALUES ('en', '_module','wordpress_db_pwd','WordPress Database Password',NOW(),'');\r
INSERT INTO `language_text` VALUES ('en', '_module','wordpress_db_prefix','WordPress Database Table Prefix',NOW(),'');\r
INSERT INTO `language_text` VALUES ('en', '_module','wordpress_save','Save',NOW(),'');\r
$news = array();
- $sql = "SELECT ID, post_title, guid, post_modified FROM ".WP_DB_PREFIX."posts ORDER BY post_modified DESC ".$link_limit;
+ $sql = "SELECT ID, post_title, guid, post_content, post_modified FROM ".WP_DB_PREFIX."posts WHERE post_status = 'publish' ORDER BY post_modified DESC ".$link_limit;
-
$result = mysql_query($sql, $db_wp);
if($result){
//$page_ids = array();
$post_title = array();
while($row = mysql_fetch_assoc($result)){
-
+ if(strlen($row['post_content']) > 100){
+ $row['post_content'] = substr($row['post_content'],0,100)."...";
+ }
if(!in_array($row['post_title'], $post_title)){
$post_title[] = $row['post_title'];
$news[] = array('time'=> $row['post_modified'],
'thumb'=>'mods/wordpress/wordpress_icon_sm.png',
'link'=>'<a href="'.AT_BASE_HREF.url_rewrite('mods/wordpress/index_mystart.php?p='.$row['ID']).'"'.
(strlen($row['post_title']) > SUBLINK_TEXT_LEN ? ' title="'.$row['post_title'].'"' : '') .'>'.
- validate_length($row['post_title'], SUBLINK_TEXT_LEN, VALIDATE_LENGTH_FOR_DISPLAY) .'</a>');
+ validate_length($row['post_title'], SUBLINK_TEXT_LEN, VALIDATE_LENGTH_FOR_DISPLAY) .'</a> <br />'.$row['post_content']);
}
}
}
global $db_wp;
-
-
$link_limit = 3; // Number of links to be displayed on "detail view" box
-$sql = "SELECT ID, post_title, guid FROM ".WP_DB_PREFIX."posts ORDER BY post_modified DESC LIMIT $link_limit";
-
-//$sql = "SELECT hello_world_id, value FROM ".TABLE_PREFIX."hello_world WHERE course_id=".$_SESSION[course_id].
-// " ORDER BY value LIMIT $link_limit";
-if(!$result = mysql_query($sql, $db_wp)){
- echo _AT('wordpress_no_db_info');
- return 0;
-
+$sql = "SELECT ID, post_title, guid FROM ".WP_DB_PREFIX."posts WHERE post_status = 'publish' ORDER BY post_modified DESC LIMIT $link_limit";
+
+$result = mysql_query($sql, $db_wp);
+$wp_posts = array();
+$i = 1;
+while($row = mysql_fetch_assoc($result)){
+ $wp_posts[$i] = $row;
+ $i++;
}
-if (mysql_num_rows($result) > 0) {
- while ($row = mysql_fetch_assoc($result)) {
- /****
- * SUBLINK_TEXT_LEN, VALIDATE_LENGTH_FOR_DISPLAY are defined in include/lib/constance.lib.inc
- * SUBLINK_TEXT_LEN determins the maxium length of the string to be displayed on "detail view" box.
- *****/
- $list[] = '<a href="'.AT_BASE_HREF.url_rewrite('mods/wordpress/index.php?p='. $row['ID']).'"'.
- (strlen($row['value']) > SUBLINK_TEXT_LEN ? ' title="'.$row['value'].'"' : '') .'>'.
- validate_length($row['post_title'], SUBLINK_TEXT_LEN, VALIDATE_LENGTH_FOR_DISPLAY) .'</a>';
+if($wp_posts != ''){
+ foreach($wp_posts as $key=>$value){
+ $list[] = '<a href="'.AT_BASE_HREF.url_rewrite('mods/wordpress/index.php?p='. $value['ID']).'"'.
+ (strlen($row['value']) > SUBLINK_TEXT_LEN ? ' title="'.$row['value'].'"' : '') .'>'.
+ validate_length($value['post_title'], SUBLINK_TEXT_LEN, VALIDATE_LENGTH_FOR_DISPLAY) .'</a>';
}
- return $list;
+ return $list;
} else {
- return 0;
+ return 0;
}
?>
\ No newline at end of file
define('WP_DB_HOST', 'localhost'); #default "localhost"
define('WP_DB_PORT', '3600'); #default "3600"
-?>
\ No newline at end of file
+?>