guess350
Forum Replies Created
-
Forum: Developing with WordPress
In reply to: dont show page when not logged ini used ‘allow PHP in post’ plugin and able to hide content if the user is not logged in. (also, i can display content based on user’s access permission.
i simply use user’s last name and assign ‘GROUP’ to determine what content will be shown.
(ie GroupA, GroupB etc). each group will see different content.
sample is below
———– start code —————-
[php]
global $current_user;
get_currentuserinfo();
$pos5 = strrpos($current_user->user_lastname, ‘GroupB’);if ( is_user_logged_in() )
{
if ($current_user->user_login == ‘admin’ || $current_user->user_lastname == ‘Editor’ || !($pos5===false) ) {
echo (‘<hr><b><u>UPLOAD Operation:</b></u></br><font size=”2″>Please specify folder before you upload. Root folder is \’CalSig\’.<br>To upload file into sub folder, select Root folder first, and then select the sub folder.</br>Max upload speed supported is 2MB/s.</br><u>It is recommended to use a ZIP file if you wsih to upload multiple files.</u></font>’);echo do_shortcode(‘[fileup manager=”on” boxtheme=”yang” makedir=”true” directories=”on” base=2 sub=”CalSig” maxsize=”500″ maxsizetype=”m” uploadlabel=”UPLOAD”]’);
echo (‘</br>[maxbutton id=”1″]</font><hr><b><u>CURRENT File(s) on RSE portal:</b></u></br>To Upload file(s), use the upper section.</br>To add new folder, click “+ new”‘);
if ($current_user->user_lastname == ‘Editor’)
echo do_shortcode(‘[fileaway type=”table” manager=”on” customdata=”Uploaded By” directories=”on” base=2 sub=”CalSig” name=”‘ . $current_user->user_login . ‘” ]’);
else
echo do_shortcode(‘[fileaway type=”table” customdata=”Uploaded By” directories=”on” base=2 sub=”CalSig” name=”‘ . $current_user->user_login . ‘” ]’);
}
else {
echo (‘<hr>’);
echo do_shortcode(‘[fileaway directories=”on” base=2 sub=”CalSig” name=”‘ . $current_user->user_login . ‘” showto=”subscriber”]’);
}}
else {
echo (‘Only registered user can view the content’);
}
[/PHP]
——————end code ——————————–good luck
Forum: Fixing WordPress
In reply to: WordPress emails not sending – contact form 7 not working alsohi,
i noticed that the email (submit thru the contact form 7) will be filtered as ‘spam email’.
i doubt that MS exchange or email filter service may likely deleted or filter it.my work around is direct the email to gmail, and make sure you filter the email from getting into the spam folder.
hope it helps.Forum: Plugins
In reply to: [File Away] email-notification for uploadsis email-notice possible for ‘delete operation’ as well?
Forum: Plugins
In reply to: [File Away] activate director tree and manager modehi,
i included a working [PHP] code below, which is working on my site.
You can copy and paste to a new PAGE and check if this is working for you.
If the code is working, you can start updating it for your need.
btw, you do need to log in first, in order to see the content.
i currently only use 2 levels of user roles, admin and subscriber.
please create users as ‘subscriber’ to test this code.
also, the ‘admin’ role is also supported.
good luck.
———-start code————————————————-
[php]
global $current_user;
get_currentuserinfo();
if ( is_user_logged_in() )
{
if ($current_user->user_login == admin) {
echo do_shortcode(‘[fileaway manager=”on” directories=”on” base=2 name=”‘ . $current_user->user_login . ‘” showto=”administrator”]’);
}
else {
echo do_shortcode(‘[fileaway manager=”on” directories=”on” base=2 sub=”‘ . $current_user->user_login . ‘” name=”‘ . $current_user->user_login . ‘” showto=”subscriber”]’);
}
}
else {
echo (‘Only registered user can view the content’);
}
[/PHP]Forum: Plugins
In reply to: [File Away] File Away Creating multiple folders for multiple user rolesI was able to implement multiple users and each user will have a separate folder. The code will generate folder for you. You just need to create USER in the WordPress.
My base folder is hard-coded to upload2, all user’s folder will be under it.
I included my code below. (double check your Fileaway’s Option)
if you log in as admin, the VAULT page will display all folders for all users.
Contact me if you have question. ( 350inusa @ gmail.com)//———————- start UPLOAD page
[PHP]
global $current_user;
get_currentuserinfo();if ( is_user_logged_in() )
{
echo (‘(500MB size limit per file)’);
echo do_shortcode (‘[fileup makedir=”true” fixedlocation=”‘ . $current_user->user_login . ‘” maxsize=”500″ maxsizetype=”m” uploadlabel=”UPLOAD now” base=2 sub=”‘ . $current_user->user_login . ‘” drawerid=2 uploader=”‘ . $current_user->user_login . ‘” matchdrawer=”2″ theme=”silver-bullet”]’ );
echo (‘<hr>
‘);
echo (‘If you have multiple files to upload, please zip them into 1 zip file, and then upload the zip file.
‘);
echo (‘<b>Please send an email to involved party after the upload is completed.’);
}
else
{
echo (‘
<font color=”red”>This feature is for registered user only. Please contact RSE staff for assistance.</font>’);
}
[/PHP]
//—————————- end UPLOAD page#########################################################################
//—————————–start VAULT page (display uploaded files)
[PHP]
global $current_user, $filecount;
get_currentuserinfo();
if ( is_user_logged_in() )
{
if ($current_user->user_login == ‘admin’)
{
echo do_shortcode( ‘[fileaway type=”table” customdata=”Uploaded By” base=”2″ directories=”on”]’);
}
else
{
$directory = “./upload2/” . $current_user->user_login; // dir location
$files = scandir($directory);
for($i = 0 ; $i < count($files) ; $i++){
if($files[$i] !=’.’ && $files[$i] !=’..’){
$file_new[] = $files[$i];
}
}
$num_files = count($file_new)-1;
echo (‘File Count: ‘ . $num_files ); // Prints out how many were in the directory
echo do_shortcode( ‘[fileaway type=”table” customdata=”Uploaded By” base=”2″ sub=”‘ .
$current_user->user_login . ‘”]’);
}
}
else
{
echo (‘
<font color=”red”>This feature is for registered user only. Please contact RSE staff for assistance.</font>’);
}[/PHP]
//—————————- end VAULT pageForum: Plugins
In reply to: [File Away] Count filesfor my case, i don’t allow user to create sub folders.
i asked users to use zip file instead for multiple files/sub folders.
my main purpose is to provide quick file exchange without too much complex interface.but, maybe one of the php experts may be able to come up with a better code to handle recursive directory.
Forum: Plugins
In reply to: [File Away] email-notification for uploadsThank you for the info.
I added ’email notice’ to site admin by following the info within a minute or two.Fileaway is such a wonderful plugin. Much appreciated!
Forum: Plugins
In reply to: [File Away] Count files– install “Allow PHP in Posts and Pages” plugin.
working code:
———————————————————————–
$directory = “./upload2/” . $current_user->user_login; // dir location
$files = scandir($directory);
for($i = 0 ; $i < count($files) ; $i++){
if($files[$i] !=’.’ && $files[$i] !=’..’)
{ //echo $files[$i]; echo “
“;
$file_new[] = $files[$i];
}
}
$num_files = count($file_new)-1; // omit index.php
echo (‘File Count: ‘ . $num_files ); // Prints the count
———————————————————————–good luck.
Forum: Plugins
In reply to: [File Away] max file size issue (need more than 64 MB)i figured this out.
1. make sure the short-code has the correct size limit
2. make sure the hosting support the size, use phpinfo() to checkForum: Fixing WordPress
In reply to: #Home link issuesorry.
https://www.rsecorp.com