Post by Todge on Mar 15, 2011 11:29:56 GMT -8
This will give your members the ability to start a gallery for themselves.
First, create a new board for your gallery, and only allow registered members to post to it.
Then, put this in the board's HEADER..
And put this in your board's FOOTER..
That 'should' allow your member's to start a gallery for themselves, and only they will be allowed to add images to it, though any moderator with powers to modify/delete posts will be able to do the same to the posted images.
First, create a new board for your gallery, and only allow registered members to post to it.
Then, put this in the board's HEADER..
<table style="display: none" id="imageform" cellpadding="4" cellspacing="1" border="0" width="92%" align="center"><tbody>
<tr><td colspan="2" class="titlebg" height="18"><font size="2" class="titletext"><b>Add Image to Gallery</b></font></td></tr>
<tr id="gTitle"><td class="windowbg" width="30%"><font size="2">Gallery Title:</font></td><td class="windowbg" width="70%"><input id="galleryname" name="galleryname" size="70" maxlength="60" type="text" style="width: 70%;"></td></tr>
<tr><td class="windowbg" width="30%"><font size="2">Image URL:</font></td><td class="windowbg" width="70%"><input id="imageurl" name="imageurl" size="70" maxlength="120" type="text" style="width: 70%;"></td></tr>
<tr><td class="windowbg2" valign="top"><font size="2">Message:</font></td><td class="windowbg2" width="70%"><textarea id="picmessage" name="picmessage" rows="3" cols="70" wrap="soft" style="width: 70%;"></textarea></td></tr>
<tr><td colspan="2" class="titlebg" align="center"><input value="Post Image" id="postimage" type="button"> </td></tr>
</tbody></table>
<div id="gallery" align="center" style="display: none";><a href="/index.cgi">Back to Home Page</a> :: <a href="#" onclick="location.href=location.href.split(/&action/)[0]";>Back to Gallery List</a><br><font size="7" color="red"><b><u id="gName">The Gallery</u></b></font><br><br></div>
<div id="theforum">
And put this in your board's FOOTER..
</div>
<script type="text/javascript">
<!--
/*
Member Galleries
by Todge
Copyright © 2011
Please keep this header intact
*/
if(pb_action == 'display')
{
var gallery = document.getElementById('gallery');
var board = document.getElementById('theforum')
var peep = '';
board.style.display = 'none';
gallery.style.display = '';
var miniPro = board.getElementsByTagName('td');
for(m=0; m<miniPro.length; m++)
{
if(miniPro[m].className.match(/windowbg/) && miniPro[m].align == 'left' && miniPro[m].width == '20%')
{
var modifyImage = '';
var deleteImage = '';
document.getElementById('gName').innerHTML = document.title.split(/ - /)[1];
if(miniPro[m].nextSibling.getElementsByTagName('a')[1].href.match(/tion=modifypost/))
{
modifyImage = miniPro[m].nextSibling.getElementsByTagName('a')[1].href;
deleteImage = miniPro[m].nextSibling.getElementsByTagName('a')[2].href;
}
var piccies = miniPro[m].nextSibling.getElementsByTagName('img');
for(p=0; p<piccies.length; p++)
{
if(piccies[p].title == '[image] ')
{
var message = piccies[p].nextSibling;
piccies[p].title = piccies[p].previousSibling.innerHTML;
var peep = piccies[p].title;
gallery.appendChild(piccies[p]);
gallery.appendChild(document.createElement('br'));
gallery.appendChild(message);
gallery.appendChild(document.createElement('br'));
if(modifyImage.length > 1)
{
var opts = document.createElement('font');
opts.innerHTML = '<a href="'+modifyImage+'">Modify</a> or <a href="'+deleteImage+'">Delete</a> this entry.';
gallery.appendChild(opts);
gallery.appendChild(document.createElement('br'));
}
gallery.appendChild(document.createElement('br'));
break;
}}}}
var post = document.getElementsByTagName('a');
for(p=0; p<post.length; p++)
{
if(post[p].href.match(/tion=post/) && !post[p].href.match(/quote=/) && peep == pb_username)
{
gallery.innerHTML += '<font size="5"><b><a href="'+post[p].href+'">Post an image to this gallery</a></b></font><br><br>';
break;
}}
var span = document.getElementsByTagName('span');
for(s=0; s<span.length; s++)
{
if(span[s].className == 'pagejump')
{
gallery.appendChild(span[s].parentNode);
break;
}}}
if(document.postForm)
{
document.getElementById('theforum').style.display = 'none';
document.getElementById('gallery').style.display = 'none';
document.getElementById('imageform').style.display = '';
if(document.postForm.subject.value == '')
{
document.getElementById('galleryname').value = pb_displayname+'\'s Gallery';
document.postForm.subject.value = pb_displayname+'\'s Gallery';
}
else
{
document.getElementById('gTitle').style.display = 'none';
document.postForm.subject.value = document.postForm.subject.value.replace(/Re: /,'');
}
var message = document.postForm.message;
var poster = '[i]'+pb_username+'[/i]';
var postedImage = '';
var postedMessage = '';
if(message.value.length > 1)
{
poster = message.value.split(/\[img\]/i)[0];
postedImage = message.value.split(/\[img\]/i)[1].split(/\[\/img\]/i)[0];
postedMessage = message.value.split(/\[\/img\]\[i\]/i)[1].split(/\[\/i\]/i)[0];
}
document.getElementById('imageurl').value = postedImage;
document.getElementById('picmessage').value = postedMessage;
document.getElementById('postimage').onclick = function()
{
if(!document.getElementById('imageurl').value.match(/^http:\/\//) || !document.getElementById('imageurl').value.match(/\.(gif|png|jpg|jpeg)$/i))
{
alert('Please ensure you post a valid image URL\n\nMust start with "http://" and end with ".gif",".png",".jpg" or ".jpeg"');
}
else
{
if(document.getElementById('galleryname').value.length > 0)
{
document.postForm.subject.value = document.getElementById('galleryname').value;
}
message.value = poster+'[im'+'g]'+document.getElementById('imageurl').value+'[/i'+'mg][i]'+document.getElementById('picmessage').value+'[/i]';
document.postForm.submit();
}}}
// -->
</script>
That 'should' allow your member's to start a gallery for themselves, and only they will be allowed to add images to it, though any moderator with powers to modify/delete posts will be able to do the same to the posted images.