diff --git a/e107_files/shortcode/batch/user_shortcodes.php b/e107_files/shortcode/batch/user_shortcodes.php index 3b141839e..cccd954c4 100644 --- a/e107_files/shortcode/batch/user_shortcodes.php +++ b/e107_files/shortcode/batch/user_shortcodes.php @@ -11,9 +11,9 @@ | GNU General Public License (http://gnu.org). | | $Source: /cvs_backup/e107_0.8/e107_files/shortcode/batch/user_shortcodes.php,v $ -| $Revision: 1.2 $ -| $Date: 2006-12-07 15:41:50 $ -| $Author: sweetas $ +| $Revision: 1.3 $ +| $Date: 2007-03-27 13:48:30 $ +| $Author: lisa_ $ +----------------------------------------------------------------------------+ */ if (!defined('e107_INIT')) { exit; } @@ -550,6 +550,83 @@ SC_BEGIN USER_FORM_SUBMIT return ""; SC_END +SC_BEGIN USER_EMBED_USERPROFILE +global $pref, $USER_EMBED_USERPROFILE_TEMPLATE, $embed_already_rendered; + +//if no parm, it means we render ALL embedded contents +//so we're preloading all registerd e_userprofile files +$key = varset($pref['e_userprofile_list']); + +//if we don't have any embedded contents, return +if(!is_array($key) || empty($key)){ return; } + +//array holding specific hooks to render +$render=array(); + +if($parm){ + + //if the first char of parm is an ! mark, it means it should not render the following parms + if(strpos($parm,'!')===0){ + $tmp = explode(",", substr($parm,1) ); + foreach($tmp as $not){ + $not=trim($not); + if(isset($key[$not])){ + //so we're unsetting them from the $key array + unset($key[$not]); + } + } + + //else it means we render only the following parms + }else{ + $tmp = explode(",", $parm ); + foreach($tmp as $yes){ + $yes=trim($yes); + if(isset($key[$yes])){ + //so add the ones we need to render to the $render array + $render[$yes] = $key[$yes]; + } + } + //finally assign the render array as the key array, overwriting it + $key = $render; + } +} + +foreach($key as $hook){ + //include the e_user file and initiate the class + if(is_readable(e_PLUGIN.$hook."/e_userprofile.php")){ + //if the current hook is not yet rendered + if(!in_array($hook, $embed_already_rendered)){ + require_once(e_PLUGIN.$hook."/e_userprofile.php"); + $name = "e_userprofile_{$hook}"; + if(function_exists($name)){ + $arr[] = $name(); + //we need to store which hooks are already rendered + $embed_already_rendered[] = $hook; + } + } + } +} + +$ret = ''; +foreach($arr as $data){ + if(is_array($data['caption'])){ + foreach($data['caption'] as $k=>$v){ + if(isset($data['caption'][$k]) && isset($data['text'][$k])){ + $search = array('{USER_EMBED_USERPROFILE_CAPTION}', '{USER_EMBED_USERPROFILE_TEXT}'); + $replace = array($data['caption'][$k], $data['text'][$k]); + $ret .= str_replace($search, $replace, $USER_EMBED_USERPROFILE_TEMPLATE); + } + } + }else{ + if(isset($data['caption']) && isset($data['text'])){ + $search = array('{USER_EMBED_USERPROFILE_CAPTION}', '{USER_EMBED_USERPROFILE_TEXT}'); + $replace = array($data['caption'], $data['text']); + $ret .= str_replace($search, $replace, $USER_EMBED_USERPROFILE_TEMPLATE); + } + } +} +return $ret; +SC_END */ -?> +?> \ No newline at end of file diff --git a/e107_handlers/plugin_class.php b/e107_handlers/plugin_class.php index ea85a2e31..a47d7d089 100644 --- a/e107_handlers/plugin_class.php +++ b/e107_handlers/plugin_class.php @@ -11,9 +11,9 @@ | GNU General Public License (http://gnu.org). | | $Source: /cvs_backup/e107_0.8/e107_handlers/plugin_class.php,v $ -| $Revision: 1.5 $ -| $Date: 2007-02-14 21:17:03 $ -| $Author: e107steved $ +| $Revision: 1.6 $ +| $Date: 2007-03-27 13:48:30 $ +| $Author: lisa_ $ +----------------------------------------------------------------------------+ */ @@ -21,7 +21,7 @@ if (!defined('e107_INIT')) { exit; } class e107plugin { - var $plugin_addons = array("e_rss", "e_notify", "e_linkgen", "e_list", "e_bb", "e_meta", "e_emailprint", "e_frontpage", "e_latest", "e_status", "e_search", "e_sc", "e_module", "e_comment", "e_sql"); + var $plugin_addons = array("e_rss", "e_notify", "e_linkgen", "e_list", "e_bb", "e_meta", "e_emailprint", "e_frontpage", "e_latest", "e_status", "e_search", "e_sc", "e_module", "e_comment", "e_sql", "e_userprofile"); // List of all plugin variables which need to be checked - install required if one or more set and non-empty var $all_eplug_install_variables = array( diff --git a/e107_plugins/content/e_userprofile.php b/e107_plugins/content/e_userprofile.php new file mode 100644 index 000000000..671027d10 --- /dev/null +++ b/e107_plugins/content/e_userprofile.php @@ -0,0 +1,89 @@ + db_Select("pcontent", "*", "content_class REGEXP '".e_CLASS_REGEXP."' AND content_parent = '0' ".$datequery." ".$headingquery." ORDER BY content_heading")){ + while($rowm = $sqlm -> db_Fetch()){ + //global var for this main parent + $mainparent = $rowm['content_id']; + $maincaption = $rowm['content_heading']; + + $text = ''; + + //prepare query paramaters + $array = $aa -> getCategoryTree("", $mainparent, TRUE); + $validparent = implode(",", array_keys($array)); + $qry = " p.content_parent REGEXP '".$aa -> CONTENTREGEXP($validparent)."' "; + $datequery = " AND p.content_datestamp < ".time()." AND (p.content_enddate=0 || p.content_enddate>".time().") "; + $content_pref = $aa -> getContentPref($mainparent); + $content_icon_path = $tp -> replaceConstants($content_pref["content_icon_path"]); + $l = strlen($userid)+1; + $userquery = " AND (p.content_author = '".$userid."' || LEFT(p.content_author, ".$l.") = '".$userid."^' OR SUBSTRING_INDEX(p.content_author, '^', 1) = '".$userid."' ) "; + + $qry = " + SELECT p.content_id, p.content_heading, p.content_subheading, p.content_icon, p.content_datestamp + FROM #pcontent AS p + WHERE LEFT(p.content_parent,1) != '0' + AND ".$qry." ".$datequery." + AND p.content_class REGEXP '".e_CLASS_REGEXP."' + ".$userquery." + ORDER BY p.content_heading "; + $qry1 = $qry." LIMIT 0,3"; + + $found=false; + $sqlc = new db; + $total = $sqlc -> db_Select_gen($qry); + if($sqlc -> db_Select_gen($qry1)){ + + while($rowc = $sqlc -> db_Fetch()){ + + $icon=''; + if($rowc['content_icon'] && is_readable($content_icon_path.$rowc['content_icon'])){ + $icon = ""; + }else{ + $icon = ""; + } + + $date = strftime("%d %b %Y", $rowc['content_datestamp']); + $subheading = ($row['content_subheading'] ? $row['content_subheading']."
" : ''); + + $text .= " +
+
".$icon."
+
+ ".$tp->toHTML($rowc['content_heading'], TRUE, "")."
+ ".$subheading." + ".$date." +
+
"; + + $id = $rowc['content_id']; + $found=true; + } + $lan0 = str_replace('{caption}',$maincaption, CONTENT_USERPROFILE_LAN_1); + $text .= "
".$lan0."
"; + } + if($found){ + $caption[] = str_replace(array('{caption}','{total}'),array($maincaption, $total), CONTENT_USERPROFILE_LAN_2); + $data[] = $text; + } + } + return array('caption'=>$caption, 'text'=>$data); + } + } +} + +?> \ No newline at end of file diff --git a/e107_plugins/content/languages/English/lan_content.php b/e107_plugins/content/languages/English/lan_content.php index 7aa16bbea..50cb70df2 100644 --- a/e107_plugins/content/languages/English/lan_content.php +++ b/e107_plugins/content/languages/English/lan_content.php @@ -4,8 +4,8 @@ | e107 website system - Language File. | | $Source: /cvs_backup/e107_0.8/e107_plugins/content/languages/English/lan_content.php,v $ -| $Revision: 1.3 $ -| $Date: 2007-03-13 16:51:05 $ +| $Revision: 1.4 $ +| $Date: 2007-03-27 13:48:30 $ | $Author: lisa_ $ +----------------------------------------------------------------------------+ */ @@ -15,6 +15,9 @@ define("CONTENT_EMAILPRINT_LAN_1", "this content item is from"); define("POPUP_LAN_1", "click to enlarge image"); +define("CONTENT_USERPROFILE_LAN_1", ">> view all content {caption} items"); +define("CONTENT_USERPROFILE_LAN_2", "content {caption}: {total} items found"); + define("CONTENT_NOTIFY_LAN_1", "Content Events"); define("CONTENT_NOTIFY_LAN_2", "Content item submitted by user"); define("CONTENT_NOTIFY_LAN_3", "Content Submitted"); diff --git a/e107_plugins/links_page/e_userprofile.php b/e107_plugins/links_page/e_userprofile.php new file mode 100644 index 000000000..ba44672c9 --- /dev/null +++ b/e107_plugins/links_page/e_userprofile.php @@ -0,0 +1,63 @@ + db_Select_gen($qry); + if($sql -> db_Select_gen($qry1)){ + include_lan(e_PLUGIN."links_page/languages/".e_LANGUAGE.".php"); + while($row = $sql -> db_Fetch()){ + + $LINK_APPEND = ""; + + $icon = $LINK_APPEND.""; + if ($row['link_button']) { + if (strpos($row['link_button'], "http://") !== FALSE) { + $icon = $LINK_APPEND.""; + } else { + if(strstr($row['link_button'], "/")){ + if(is_readable(e_BASE.$row['link_button'])){ + $icon = $LINK_APPEND.""; + } + }else{ + if(is_readable(e_PLUGIN."links_page/link_images/".$row['link_button'])){ + $icon = $LINK_APPEND.""; + } + } + } + } + + $date = strftime("%d %b %Y", $row['link_datestamp']); + $heading = ($row['link_name'] ? $LINK_APPEND.$tp->toHTML($row['link_name'], TRUE)."
" : ''); + + $text .= " +
+
".$icon."
+
+ ".$heading." + ".$date." +
+
"; + } + $text .= "
".LCLAN_USERPROFILE_1."
"; + } + $caption = str_replace('{total}',$total, LCLAN_USERPROFILE_2); + return array('caption'=>$caption, 'text'=>$text); + } +} + +?> \ No newline at end of file diff --git a/e107_plugins/links_page/languages/English.php b/e107_plugins/links_page/languages/English.php index 42927e636..55a4df599 100644 --- a/e107_plugins/links_page/languages/English.php +++ b/e107_plugins/links_page/languages/English.php @@ -4,15 +4,14 @@ | e107 website system - Language File. | | $Source: /cvs_backup/e107_0.8/e107_plugins/links_page/languages/English.php,v $ -| $Revision: 1.2 $ -| $Date: 2006-12-29 12:58:37 $ -| $Author: e107steved $ +| $Revision: 1.3 $ +| $Date: 2007-03-27 13:48:30 $ +| $Author: lisa_ $ +----------------------------------------------------------------------------+ */ -// if(!defined("PAGE_NAME")){define("PAGE_NAME", "Links");} <-- -// Lisa, could you please move this out of the language file ? - +define("LCLAN_USERPROFILE_1", ">> view all links"); +define("LCLAN_USERPROFILE_2", "links: {total} links found"); define("LCLAN_PLUGIN_LAN_1", "Links Page"); define("LCLAN_PLUGIN_LAN_2", "Links Page For Displaying External Web Links"); diff --git a/e107_themes/templates/user_template.php b/e107_themes/templates/user_template.php index 413a6ca71..1223d1e08 100644 --- a/e107_themes/templates/user_template.php +++ b/e107_themes/templates/user_template.php @@ -11,9 +11,9 @@ | GNU General Public License (http://gnu.org). | | $Source: /cvs_backup/e107_0.8/e107_themes/templates/user_template.php,v $ -| $Revision: 1.1.1.1 $ -| $Date: 2006-12-02 04:36:13 $ -| $Author: mcfly_e107 $ +| $Revision: 1.2 $ +| $Date: 2007-03-27 13:48:30 $ +| $Author: lisa_ $ +----------------------------------------------------------------------------+ */ @@ -185,6 +185,7 @@ $USER_FULL_TEMPLATE = " ".LAN_146." {USER_VISITS} +{USER_EMBED_USERPROFILE} {USER_UPDATE_LINK} @@ -200,4 +201,9 @@ $USER_FULL_TEMPLATE = " {PROFILE_COMMENTS} {PROFILE_COMMENT_FORM} "; + +$USER_EMBED_USERPROFILE_TEMPLATE = " +{USER_EMBED_USERPROFILE_CAPTION} +{USER_EMBED_USERPROFILE_TEXT}"; + ?> \ No newline at end of file