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 .= "
+