Facebook  Twitter 

SMFHacks.com

+-

SMFHacks.com

+- User Information

Welcome, Guest.
Please login or register.
 
 
 
Forgot your password?

+- Forum Stats

Members
Total Members: 4255
Latest: andreios
New This Month: 3
New This Week: 1
New Today: 0
Stats
Total Posts: 43260
Total Topics: 7518
Most Online Today: 297
Most Online Ever: 2482
(April 09, 2011, 07:02:45 pm)
Users Online
Members: 1
Guests: 272
Total: 273

Author Topic: Link for "My Pictures"  (Read 13549 times)

0 Members and 1 Guest are viewing this topic.

Offline MinasC

  • Member
  • *
  • Posts: 36
    • View Profile
Link for "My Pictures"
« on: October 28, 2007, 06:02:27 pm »
hello there,

i recently put a drop down menu to my forum and i tried to put there a link for "My Pictures" of the forum's gallery , so that every member could see his/her own pics with a click ! i looked in Gallery.template.php and found that the link was

Code: [Select]
<a href="' . $scripturl . '?action=gallery;sa=myimages;u=' . $ID_MEMBER . '">' . $txt['gallery_text_myimages'] . '</a>
so i put that in my menu but it didn't work ! instead i get the message "no user has been chosen" ! i used several similar links such as

Code: [Select]
<a href="' . $scripturl . '?action=gallery;sa=myimages;u=' . $row['ID_MEMBER'] . '">' . $txt['gallery_text_myimages'] . '</a>but none worked either ! anyone knows what is the right link ?

thnx in advance !

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16436
    • View Profile
Re: Link for "My Pictures"
« Reply #1 on: October 28, 2007, 07:47:21 pm »
I would need to see the whole function that you are trying to add that code to
Get your Forum Ranked! at https://www.forumrankings.net - find out how your forum compares with others!

Like What I do? Support me at https://www.patreon.com/vbgamer45/

Offline MinasC

  • Member
  • *
  • Posts: 36
    • View Profile
Re: Link for "My Pictures"
« Reply #2 on: October 29, 2007, 05:05:19 am »
here's the whole script i use

in the head section

Code: [Select]
<style type="text/css">

#dropmenudiv{
position:absolute;
border:1px solid blue;
border-bottom-width: 0;
font:normal 10px Verdana;
line-height:15px;
z-index:100;
}

#dropmenudiv a{
width: 100%;
display: block;
text-indent: 3px;
border-bottom: 1px solid blue;
padding: 1px 0;
text-decoration: none;
font-weight: normal;
}

#dropmenudiv a:hover{ /*hover background color*/
background-color: orange;
}

</style>

<script type="text/javascript">

/***********************************************
* AnyLink Drop Down Menu- © Dynamic Drive (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/

//Contents for menu 1
var menu1=new Array()
menu1[0]=\'<a href="', $scripturl, '?action=gallery">All Pictures</a>\'
menu1[1]=\'<a href="' . $scripturl . '?action=gallery;sa=myimages;u=' . $_GET['u'] . '">My Pictures</a>\'
menu1[2]=\'<a href="', $scripturl, '?action=gallery;sa=search">Search Pictures</a>\'
menu3[3]=\'<a href="', $scripturl, '?action=gallery;sa=add">Add Picture</a>\'

var menuwidth=\'200px\' //default menu width
var menubgcolor=\'lightblue\'  //menu bgcolor
var disappeardelay=200  //menu disappear speed onMouseout (in miliseconds)
var hidemenu_onclick="yes" //hide menu when user clicks within menu?

/////No further editting needed

var ie4=document.all
var ns6=document.getElementById&&!document.all

if (ie4||ns6)
document.write(\'<div id="dropmenudiv" style="visibility:hidden;width:\'+menuwidth+\';background-color:\'+menubgcolor+\'" onMouseover="clearhidemenu()" onMouseout="dynamichide(event)"></div>\')

function getposOffset(what, offsettype){
var totaloffset=(offsettype=="left")? what.offsetLeft : what.offsetTop;
var parentEl=what.offsetParent;
while (parentEl!=null){
totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
parentEl=parentEl.offsetParent;
}
return totaloffset;
}


function showhide(obj, e, visible, hidden, menuwidth){
if (ie4||ns6)
dropmenuobj.style.left=dropmenuobj.style.top="-500px"
if (menuwidth!=""){
dropmenuobj.widthobj=dropmenuobj.style
dropmenuobj.widthobj.width=menuwidth
}
if (e.type=="click" && obj.visibility==hidden || e.type=="mouseover")
obj.visibility=visible
else if (e.type=="click")
obj.visibility=hidden
}

function iecompattest(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function clearbrowseredge(obj, whichedge){
var edgeoffset=0
if (whichedge=="rightedge"){
var windowedge=ie4 && !window.opera? iecompattest().scrollLeft+iecompattest().clientWidth-15 : window.pageXOffset+window.innerWidth-15
dropmenuobj.contentmeasure=dropmenuobj.offsetWidth
if (windowedge-dropmenuobj.x < dropmenuobj.contentmeasure)
edgeoffset=dropmenuobj.contentmeasure-obj.offsetWidth
}
else{
var topedge=ie4 && !window.opera? iecompattest().scrollTop : window.pageYOffset
var windowedge=ie4 && !window.opera? iecompattest().scrollTop+iecompattest().clientHeight-15 : window.pageYOffset+window.innerHeight-18
dropmenuobj.contentmeasure=dropmenuobj.offsetHeight
if (windowedge-dropmenuobj.y < dropmenuobj.contentmeasure){ //move up?
edgeoffset=dropmenuobj.contentmeasure+obj.offsetHeight
if ((dropmenuobj.y-topedge)<dropmenuobj.contentmeasure) //up no good either?
edgeoffset=dropmenuobj.y+obj.offsetHeight-topedge
}
}
return edgeoffset
}

function populatemenu(what){
if (ie4||ns6)
dropmenuobj.innerHTML=what.join("")
}


function dropdownmenu(obj, e, menucontents, menuwidth){
if (window.event) event.cancelBubble=true
else if (e.stopPropagation) e.stopPropagation()
clearhidemenu()
dropmenuobj=document.getElementById? document.getElementById("dropmenudiv") : dropmenudiv
populatemenu(menucontents)

if (ie4||ns6){
showhide(dropmenuobj.style, e, "visible", "hidden", menuwidth)
dropmenuobj.x=getposOffset(obj, "left")
dropmenuobj.y=getposOffset(obj, "top")
dropmenuobj.style.left=dropmenuobj.x-clearbrowseredge(obj, "rightedge")+"px"
dropmenuobj.style.top=dropmenuobj.y-clearbrowseredge(obj, "bottomedge")+obj.offsetHeight+"px"
}

return clickreturnvalue()
}

function clickreturnvalue(){
if (ie4||ns6) return false
else return true
}

function contains_ns6(a, b) {
while (b.parentNode)
if ((b = b.parentNode) == a)
return true;
return false;
}

function dynamichide(e){
if (ie4&&!dropmenuobj.contains(e.toElement))
delayhidemenu()
else if (ns6&&e.currentTarget!= e.relatedTarget&& !contains_ns6(e.currentTarget, e.relatedTarget))
delayhidemenu()
}

function hidemenu(e){
if (typeof dropmenuobj!="undefined"){
if (ie4||ns6)
dropmenuobj.style.visibility="hidden"
}
}

function delayhidemenu(){
if (ie4||ns6)
delayhide=setTimeout("hidemenu()",disappeardelay)
}

function clearhidemenu(){
if (typeof delayhide!="undefined")
clearTimeout(delayhide)
}

if (hidemenu_onclick=="yes")
document.onclick=hidemenu

</script>

and in the body section

Code: [Select]
echo '<td width="90%" class="titlebg2">
<a href="', $scripturl, '?action=gallery" onClick="return clickreturnvalue()" onMouseover="dropdownmenu(this, event, menu1, \'200px\')" onMouseout="delayhidemenu()">Gallery</a>
</td>';

as you can see here

Code: [Select]
menu1[1]=\'<a href="' . $scripturl . '?action=gallery;sa=myimages;u=' . $_GET['u'] . '">My Pictures</a>\'
in my attempt to find a solution i used several alternatives (here i used ' . $_GET['u'] . ') but no luck !

i hope the solution is more clear to you !
thnx a lot !

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16436
    • View Profile
Re: Link for "My Pictures"
« Reply #3 on: October 29, 2007, 06:53:11 am »
Still need the whole function such for the php part

 fucntion template_above()
{

}

Get your Forum Ranked! at https://www.forumrankings.net - find out how your forum compares with others!

Like What I do? Support me at https://www.patreon.com/vbgamer45/

Offline MinasC

  • Member
  • *
  • Posts: 36
    • View Profile
Re: Link for "My Pictures"
« Reply #4 on: October 29, 2007, 07:23:32 am »
where do i find that ?

Offline MinasC

  • Member
  • *
  • Posts: 36
    • View Profile
Re: Link for "My Pictures"
« Reply #5 on: October 31, 2007, 03:37:39 am »
Still need the whole function such for the php part

 fucntion template_above()
{

}



where do i find that ?

i looked for it but didn't find it ! could you tell me where to look ?
thnx !

Offline MinasC

  • Member
  • *
  • Posts: 36
    • View Profile
Re: Link for "My Pictures"
« Reply #6 on: November 03, 2007, 07:52:47 am »
anyone ?  ???

Offline MinasC

  • Member
  • *
  • Posts: 36
    • View Profile
Re: Link for "My Pictures"
« Reply #7 on: November 04, 2007, 07:32:19 pm »
no luck getting help here , huh ? no obligation if it is lite ...

well , anyway , thnx to help given over to smf forum i found the solution , and i thought i should post it for anyone else might having the same one !

find in index.template.php the line where it says

Code: [Select]
global $context, $settings, $options, $scripturl, $txt, $modSettings;
and make it

Code: [Select]
global $context, $settings, $options, $scripturl, $txt, $modSettings, $ID_MEMBER;
then you can use $ID_MEMBER in any link without problems !

Offline Lil Puppy

  • Member
  • *
  • Posts: 2
    • View Profile
Re: Link for "My Pictures"
« Reply #8 on: December 02, 2007, 06:58:57 pm »
Code: [Select]
// Put the gallery link here but hide it if they cant see it
if ($context['allow_smfgallery_view'])
echo '
<a href="', $scripturl, '?action=gallery;sa=myimages;u=', $message['member']['id'], '" >', Visit, ' ', My,' ', Gallery, '</a><br />';


The link is there, that is the code that I use to put the gallery link anywhere on the forum, it will also use the permissions to hide it if they don't have permission to view the gallery.

 

Related Topics

  Subject / Started by Replies Last post
16 Replies
12449 Views
Last post January 26, 2007, 07:30:22 pm
by joh87swe
3 Replies
5410 Views
Last post May 04, 2007, 07:02:31 am
by SMFHacks
1 Replies
4415 Views
Last post May 21, 2007, 06:37:59 pm
by SMFHacks
1 Replies
8882 Views
Last post September 28, 2007, 11:46:07 am
by smalldonkey
2 Replies
8183 Views
Last post November 06, 2007, 08:55:18 pm
by dry3210

+- Recent Topics

No thumbnails on new uploads by Tonyvic
Today at 06:26:18 am

Display the Contact Page for guests by SMFHacks
March 27, 2024, 10:55:43 am

is it possible to add support for odysee.com by fvlog19
March 21, 2024, 08:47:51 am

Request for admin notification by davejo
March 10, 2024, 01:31:59 am

I need help with torrent upload by Ineedsmfhelp
March 09, 2024, 10:01:13 pm

an idea for new mod (( content type with different display )) by SMFHacks
February 27, 2024, 01:36:27 pm

[Mod] RSS Feed Poster by SMFHacks
February 27, 2024, 11:57:18 am

find duplicate pictures by fvlog19
February 14, 2024, 02:22:40 pm

Error uploading video. by SMFHacks
February 08, 2024, 02:04:16 pm

Gallery icon as last added image by fvlog19
February 01, 2024, 01:04:56 pm

Powered by EzPortal