Welcome to Geeklog, Anonymous Tuesday, December 24 2024 @ 08:53 am EST

Geeklog Forums

user photos on main


mholloway

Anonymous
We are building a news affilitate site for various affiliates to place local news into, for other affiliates to use and contribute to. I'm using the member photo option as a logo placement, and trying to get them to display on the stories and story bylines. I've gotten the place holders to come up by adding the following bit of code to lib-common.php, but can't figure out how to make the database call to get the image name to show up. Can anyone help? The code I have is as follows: $article->set_var('display_affiliate_photo', '<img src="' . $_CONF['site_url'] . '/images/userphotos/" alt="">'); Any help at all is appreciated. Each time I try to add the DB query, it just gives me an error for that line.
 Quote

Status: offline

Tony

Site Admin
Admin
Registered: 12/17/01
Posts: 405
Location:Urbandale, Iowa
If you need it for the currently logged in user (i.e. yourself) then use $_USER['photo']. If you need to get it for a group of users and you know their usernames or user id's then you need to do a bit more work: $myresult = DB_query("SELECT uid,photo FROM WHERE username = '<username>' OR username = '<username2>', etc"Wink; foreach($A in $myresult) { $photofile = $A['photo']; ...<insert other code> }
The reason people blame things on previous generations is that there's only one other choice.
 Quote

mholloway

Anonymous
Actually, it will show the image belonging to the user who wrote the article. You can see what I mean to do by looking at http://news.quinstarradio.net . The default username for Admin and password have thus far not been changed, so you can see the articles and see what I mean to do. The image name is now showing, but I can't seem to put the rest together and make it work. The following it the code I've wound up with in lib-common.php: if ($_CONF['contributedbyline'] == 1) { $article->set_var('lang_contributed_by',$LANG01[1]); if ($A['uid'] > 1) { $article->set_var('start_contributedby_anchortag', '<a class="storybyline" href="'.$_CONF['site_url'].'/users.php?mode=profile&amp;uid='.$A['uid'].'">'); $article->set_var('contributedby_user', DB_getItem($_TABLES['users'],'username',"uid = ''"Wink); $article->set_var('end_contributedby_anchortag', '</a>'); $article->set_var('affiliate_start_photo', '<img src="' . $_CONF['site_url'] . '/images/userphotos/"'); $article->set_var('display_affiliate_photo', DB_getItem($_TABLES['users'],'photo',"uid = ''"Wink); $article->set_var('affiliate_end_photo', 'alt="">'); } else { $article->set_var('contributedby_user', DB_getItem($_TABLES['users'],'username',"uid = 1"Wink); } } while in article.thtml I have: <td valign="top" width="180"> <br> <img src="/images/speck.gif" width="180" height="1" alt=""> <img src="/images/userphotos/ alt=""> I also tried: <td valign="top" width="180"> <br> Again, all help is appreciated! Mark
 Quote

All times are EST. The time is now 08:53 am.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content