Facebook  Twitter 

SMFHacks.com

+-

SMFHacks.com

+- User Information

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

+- Forum Stats

Members
Total Members: 4274
Latest: kellanphil
New This Month: 3
New This Week: 1
New Today: 0
Stats
Total Posts: 43648
Total Topics: 7571
Most Online Today: 83
Most Online Ever: 2482
(April 09, 2011, 07:02:45 pm)
Users Online
Members: 0
Guests: 50
Total: 50

Author Topic: Link for "My Pictures"  (Read 13944 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: 16612
    • 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: 16612
    • 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
12816 Views
Last post January 26, 2007, 07:30:22 pm
by joh87swe
3 Replies
5663 Views
Last post May 04, 2007, 07:02:31 am
by SMFHacks
1 Replies
4742 Views
Last post May 21, 2007, 06:37:59 pm
by SMFHacks
1 Replies
9221 Views
Last post September 28, 2007, 11:46:07 am
by smalldonkey
2 Replies
8507 Views
Last post November 06, 2007, 08:55:18 pm
by dry3210

+- Recent Topics

RESOLVED: Store Not Logging Transactions or Sending Emails by SMFHacks
January 23, 2025, 06:24:27 pm

Ability to exclude categories from ezPortal SMF Gallery random image ezblock by Alistair
January 22, 2025, 08:20:13 am

How to move SMF to new server by SMFHacks
January 21, 2025, 08:45:53 pm

Figuring out settings by SMFHacks
January 12, 2025, 04:56:14 pm

Filesizes incorrect by SMFHacks
January 12, 2025, 02:02:47 pm

December 2024 Sale! by SMFHacks
December 02, 2024, 10:30:38 pm

Denying members some admin settings by rickk
November 17, 2024, 12:02:55 pm

Weird setup by SMFHacks
November 07, 2024, 06:37:41 am

Restoring a deleted photo by Monocero
November 01, 2024, 04:23:56 am

Gallery Pro reinstalation by Lirorobert
October 14, 2024, 01:43:43 am

Powered by EzPortal