Support Forum

Advanced Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
requests-topic
Admin logo
Avatar
stayon
Member
Free Members
sp_UserOfflineSmall Offline
Feb 29, 2012 - 1:36 pm

<?php
/*
Simple:Press
Ahah call for View Member Profile
$LastChangedDate: 2012-01-29 10:34:09 -0700 (Sun, 29 Jan 2012) $
$Rev: 7822 $
*/

if (preg_match('#'.basename(__FILE__).'#', $_SERVER['PHP_SELF'])) die('Access denied - you cannot directly call this file');

sp_forum_ahah_support();
include_once(SF_PLUGIN_DIR.'/forum/content/sp-common-view-functions.php');

sp_load_editor(4);

# set up some globals for theme template files (spProfilePopup in this case) to use directly
global $spGroupView, $spThisGroup, $spForumView, $spThisForum, $spThisForumSubs,
$spThisTopic, $spThisPost, $spThisPostUser, $spNewPosts, $spThisUser,
$spProfileUser, $spMembersList, $spThisMemberGroup, $spThisMember,
$sfglobals, $sfvars;

$userid = sp_esc_int($_GET['user']);

do_action('sph_ProfileStart');

# is it a popup profile?
if (isset($_GET['action']) && $_GET['action'] == 'popup') {
if (empty($userid)) {
sp_notify(1, sp_text('Invalid profile request'));
$out.= sp_render_queued_notification();
$out.= '<div class="sfmessagestrip">';
$out.= apply_filters('sph_ProfileErrorMsg', sp_text('Sorry, an invalid profile request was detected'));
$out.= '</div>';
return $out;
}

if (file_exists(SPTEMPLATES.'spProfilePopupShow.php')) {
include_once (SF_PLUGIN_DIR.'/forum/content/sp-profile-view-functions.php');

sp_SetupUserProfileData($userid);

echo '<div id="spMainContainer">';
include (SPTEMPLATES.'spProfilePopupShow.php');
echo '</div>';
} else {
echo '<p>[spProfilePopupShow] '.sp_text('Template File not found or could not be opened.').'</p>';
}
die();
}

# check for tab press
if (isset($_GET['tab'])) {
# profile edit, so only admin or logged in user can view
if (empty($userid) || ($spThisUser->ID != $userid && !$spThisUser->admin)) {
sp_notify(1, sp_text('Invalid profile request'));
$out.= sp_render_queued_notification();
$out.= '<div class="sfmessagestrip">';
$out.= apply_filters('sph_ProfileErrorMsg', sp_text('Sorry, an invalid profile request was detected. Do you need to log in?'));
$out.= '</div>';
return $out;
}

# set up profile for requested user
include_once (SF_PLUGIN_DIR.'/forum/content/sp-profile-view-functions.php');
sp_SetupUserProfileData($userid);

# get pressed tab and menu (if pressed)
$thisTab = sp_esc_str($_GET['tab']);
$thisMenu = (isset($_GET['menu'])) ? sp_esc_str($_GET['menu']) : '';

# get all the tabs meta info
$tabs = sp_profile_get_tabs();
foreach ($tabs as $tab) {
# find the pressed tab in the list of tabs
if ($tab['slug'] == $thisTab) {
# now output the menu and content
$first = true;
$thisForm = '';
$thisName = '';
$thisSlug = '';
$out = '';
if (!empty($tab['menus'])) {
foreach ($tab['menus'] as $menu) {
# do we need an auth check?
$authCheck = (empty($menu['auth'])) ? true : sp_get_auth($menu['auth'], '', $userid);

# is this menu being displayed and does user have auth to see it?
if ($authCheck && $menu['display']) {
$current = '';
# if tab press, see if its the first
if ($first && empty($thisMenu)) {
$current = 'current';
$thisName = $menu['name'];
$thisForm = $menu['form'];
$thisSlug = $menu['slug'];
$first = false;
} else if (!empty($thisMenu)) {
# if this menu was pressed, make it the current form
if ($menu['slug'] == $thisMenu) {
$current = 'current';
$thisName = $menu['name'];
$thisForm = $menu['form'];
$thisSlug = $menu['slug'];
$thisMenu = ''; # menu press found so clear
$first = false;
}
}

# special checking for displaying menus
$spProfileOptions = sp_get_option('sfprofile');
$spAvatars = sp_get_option('sfavatars');
$noPhotos = ($menu['slug'] == 'edit-photos' && $spProfileOptions['photosmax'] < 1); # dont display edit photos if disabled
$noAvatars = ($menu['slug'] == 'edit-avatars' && !$spAvatars['sfshowavatars']); # dont display edit avatars if disabled
$hideMenu = ($noPhotos || $noAvatars);
$hideMenu = apply_filters('sph_ProfileMenuHide', $hideMenu, $tab, $menu, $userid);
if (!$hideMenu) {
# buffer the menu list while we find the current menu item
$ahahURL = SFHOMEURL.'index.php?sp_ahah=profile&sfnonce='.wp_create_nonce('forum-ahah')."&tab=$thisTab&menu=".$menu['slug'].'&user='.$userid.'&rand='.rand();
if (is_ssl()) $ahahURL = str_replace('http://', "https://", $ahahURL);
$out.= "<li class='spProfileMenuItem $current'><a rel='nofollow' href='$ahahURL' id='spProfileMenu-".esc_attr($menu['slug'])."'>".$menu['name'].'</a></li>';
}
}
}
}

# output the header area
echo '<div id="spProfileHeader">';
echo $thisName.' <small>('.sp_get_member_item($userid, 'display_name').')</small>';
echo '</div>';

# build the menus
echo '<div id="spProfileMenu">';
echo '<ul class="spProfileMenuGroup">';
echo $out; # output buffered menu list
echo '</ul>';
echo '</div>';

# build the form
echo '<div id="spProfileData">';
echo '<div id="spProfileFormPanel">';
if (!empty($thisForm) && file_exists($thisForm)) {
include_once ($thisForm);
} else {
echo sp_text('Profile form could not be found').' ['.$thisForm.']';
}
echo '</div>';
echo '</div>';
}
}

$msg = sp_text('Forum rules require you to change your password in order to view forum or save your profile');
$msg = apply_filters('sph_change_pw_msg', $msg);
$message = '<p class="spProfileFailure">'.$msg.'</p>';

global $SFMOBILE;
?>
<script type="text/javascript">
jQuery(document).ready(function() {
/* set up the profile tabs */
jQuery("#spProfileMenu li a").unbind('click').click(function() {
jQuery("#spProfileContent").html("<div><img src='<?php echo SFCOMMONIMAGES; ?>working.gif' alt='Loading' /></div>");
jQuery.ajax({async: true, url: this.href, success: function(html) {
jQuery("#spProfileContent").html(html);
}
});
return false;
});

/* adjust height of profile content area based on the current content */
spjSetProfileDataHeight();

/* show any tooltips */
<?php if (!$SFMOBILE) { ?>
jQuery(function(jQuery){vtip();})
<?php } ?>

/* show any pretty checkboxes */
jQuery("#spProfileContent input[type=checkbox], #spProfileContent input[type=radio]").prettyCheckboxes();
<?php if (isset($spThisUser->sp_change_pw) && $spThisUser->sp_change_pw) { ?>
jQuery('#spProfileMessage').html('<?php echo $message; ?>').show();
jQuery('#spProfileMessage').fadeOut(7000);
<?php } ?>
})
</script>
<?php

die();
}

if (isset($_GET['avatarremove']) && ($spThisUser->ID == $userid || $spThisUser->admin)) {
# clear avatar db record
$avatar = sp_get_member_item($userid, 'avatar');
$avatar['uploaded'] = '';
sp_update_member_item($userid, 'avatar', $avatar);
echo '<strong>'.sp_text('Uploaded Avatar Removed').'</strong>';
die();
}

if (isset($_GET['action']) && $_GET['action'] == 'avatarpool') {
global $SPPATHS;

# Open avatar pool folder and get cntents for matching
$path = SF_STORE_DIR.'/'.$SPPATHS['avatar-pool'].'/';
$dlist = @opendir($path);
if (!$dlist) {
echo '<strong>'.sp_text('The avatar pool folder does not exist').'</strong>';
die();
}

# start the table display
echo '<p align="center"'.sp_text('Avatar Pool').'</p>';
echo '<p>';
while (false !== ($file = readdir($dlist))) {
if ($file != "." && $file != "..") {
echo '<img class="spAvatarPool" src="'.esc_url(SFAVATARPOOLURL.'/'.$file).'" alt="" onclick="spjSelAvatar(\''.$file.'\', \''.esc_js("<p class=\'spCenter\'>" . sp_text('Avatar selected. Please save pool avatar') . "</p>").'\'); return jQuery(\'#dialog\').dialog(\'close\');" />  ';
}
}
echo '</p>';
closedir($dlist);
die();
}

if (isset($_GET['poolremove']) && ($spThisUser->ID == $userid || $spThisUser->admin)) {
$avatar = sp_get_member_item($userid, 'avatar');
$avatar['pool'] = '';
sp_update_member_item($userid, 'avatar', $avatar);
echo '<strong>'.sp_text('Pool Avatar Removed').'</strong>';
die();
}

die();
?>

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Feb 29, 2012 - 8:11 pm

sorry, lost with all this code in the post... what are we trying to do???

Avatar
stayon
Member
Free Members
sp_UserOfflineSmall Offline
Mar 1, 2012 - 12:15 am

ok

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Mar 1, 2012 - 7:11 pm

ok? does that mean its working now?

Avatar
stayon
Member
Free Members
sp_UserOfflineSmall Offline
Mar 2, 2012 - 11:55 am

No its not working,but it seemed like you it was to much for you,soo what should i write more,im not a highclass coder nor designer,soo please no fanzy stuff,write soo normal none coders can find what the should be looking for.

 

Thanks

Avatar
stayon
Member
Free Members
sp_UserOfflineSmall Offline
Mar 6, 2012 - 2:28 am

Hi soo what should i do to fix my problem,what should i be looking for to fix my problem here?

 

Warning: file_exists(): open_basedir restriction in effect. File(/customers/stayonpoker.com/stayonpoker.com/problem-with-post-edit-buttonttpd.www/wp-content/plugins/simple-press/forum/profile/forms/sp-form-overview.php) is not within the allowed path(s): (/customers/4/e/8/stayonpoker.com/problem-with-post-edit-buttonttpd.www:/customers/4/e/8/stayonpoker.com/problem-with-post-edit-buttonttpd.private:/customers/4/e/8/stayonpoker.com/tmp:/customers/stayonpoker.com/stayonpoker.com:/var/www/diagnostics:/usr/share/php) in /customers/4/e/8/stayonpoker.com/problem-with-post-edit-buttonttpd.www/wp-content/plugins/simple-press/forum/profile/ahah/sp-ahah-profile.php on line 141 Profile form could not be found [/customers/stayonpoker.com/stayonpoker.com/problem-with-post-edit-buttonttpd.www/wp-content/plugins/simple-press/forum/profile/forms/sp-form-overview.php]

 

the url location for this /customers/stayonpoker.com/stayonpoker.com/problem-with-post-edit-buttonttpd.www/wp-content/plugins/simple-press/forum/profile/forms/sp-form-profile.php

 

If lets say i click on prfile in forum,then profile-options-usergroups-permissons- dont work,but buddies/adversaries work fine.

 

I have to say i got no idear how to fix this problem,but i have tofix it,cos my members cant edit there profile nor can to opt in to private message.

 

Stayon

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Mar 6, 2012 - 4:15 am

I think you should contact your hosting support and send them the error message and ask them if they can set up the access that is required.

andy-signature.png
YELLOW
SWORDFISH
Avatar
stayon
Member
Free Members
sp_UserOfflineSmall Offline
Mar 6, 2012 - 4:34 am

lol thanks for your good support,fix the problem,nothing to do with my host at all,im soo happy to see your helping me out,you mad at me?

 

/customers/stayonpoker.com/stayonpoker.com/problem-with-post-edit-buttonttpd.www/wp-content/plugins/simple-press/forum/profile/forms/sp-form-memberships.php

 

Change the first bit in the top url with this /customers/4/e/8/stayonpoker.com/

 

Now all is working,hope your hand gets better.

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Mar 6, 2012 - 5:56 am

Oh excellent news. As is my hand thank you - coming along nicely! I can even use the keyboard a little now and then!

andy-signature.png
YELLOW
SWORDFISH
Forum Timezone: Europe/Stockholm
Most Users Ever Online: 1170
Currently Online:
Guest(s) 1
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Mr Papa: 19448
Ike: 2086
Brandon: 864
kvr28: 804
jim: 650
FidoSysop: 577
Conrad_Farlow: 531
fiddlerman: 358
Stefano Prete: 325
Member Stats:
Guest Posters: 620
Members: 17365
Moderators: 0
Admins: 4
Forum Stats:
Groups: 7
Forums: 17
Topics: 10128
Posts: 79626