By default, if you don't allow visitors to upload, the tickbox upload links don't show up at all. What if you want your visitors to know they can upload IF they register?
If found a way to do this using a different form popup if the user is not logged in.
Here is what I did.
First, I created a new form : "not_logged_in"
In "HTML for Custom form" I put :
<div style="text-align:center;font-weight:bold;font-size:13px;">
<div style="color:#FF0000;padding:15px 5px 25px 5px;">You must be login to upload pictures.</div>
<div><a href="http://www.YOURSITEHERE.com/login/">LogIn</a>
<a href="http://www.YOURSITEHERE.com/login/?action=register&instance=1">SignUp</a>
</div>
</div>
Then, I added this in bwb-photosmash.php
1- In the getAddPhotosLink function, I changed the height and width for the new popup like this :
if( $use_tb )
{
if ($formname == "not_logged_in") {
$this->psOptions['tb_height'] = 100;
$this->psOptions['tb_width'] = 250;
} else {
$this->psOptions['tb_height'] = (int)$this->psOptions['tb_height'] ? (int)$this->psOptions['tb_height'] : 390;
$this->psOptions['tb_width'] = (int)$this->psOptions['tb_width'] ? (int)$this->psOptions['tb_width'] : 545;
}
2- In the buildGallery function, I added a ELSE statement for the visitors (not logged in) :
if( ( $formName || !$this->psOptions['use_manualform'] ) && !$skipForm ){
if( $g['contrib_role'] == -1 || current_user_can('level_'.$g['contrib_role']) ||
current_user_can('upload_to_photosmash') || current_user_can('photosmash_'
.$g["gallery_id"])){
//Takes into account whether we're using Thickbox or not
$ret .= $this->getAddPhotosLink($g, $blogname, $formName);
//Get the Upload Form
if($this->psOptions['uploadform_visible'] || $g['form_visible'] ){
if(is_page() || is_single()){
$ret .= $this->getPhotoForm($g,$formName);
}
}else{
$ret .= $this->getPhotoForm($g, $formName);
}
}
else {
$formName = "not_logged_in";
$ret .= $this->getAddPhotosLink($g, $blogname, $formName);
$ret .= $this->getPhotoForm($g, $formName);
}
} //closes out the use_manualform condition
Now, the visitors (not logged in) get the same link (Add Photos)
but instead of the upload form popup, they get a popup telling them to log in or register if they want to upload.
AS ALWAYS, USE AT YOUR OWN RISK. I'm really not an expert!
EDIT : Well actually this is not only for visitors but for everyone who doesn't have the right to upload.
Since I allow everyone to upload (except visitors) it's ok for me.
You might wanna use !is_user_logged_in in the last function instead.
not resolved