NukeXchange Network

          

NukeZone Hosting - Fast, Affordable and Dependable
Nuke Fixes · NukeForums · NukeZone Hosting · NukeUnited · Nuke Sites · Nuke Skins · NukeLance
Nuke Resources
 :: Home  :: Downloads  :: Your Account  :: Forums  :: Advertise :: 
Login or Register
Main Menu
General
 Main
 AvantGo
 Banner_Clients
 cfaq
 Donations
 Downloads
 Forums
 Members_List
 Private_Messages
 Search
 Stories_Archive
 Submit_News
 Surveys
 Topics
 Web_Links
 Your_Account

Your Account
 Login
 Register
 Lost Pass

Modules
Quick Links
· CMS Focus
· Domain Names
. Game Quest
· Learning Linux
. MateMaker
· NukeFixes
· NukeForums
· NukeLance
· Nuke Sites
· Nuke Skins
· NukeZone Hosting
. SearchDevil
Other Options

Download Resources
· Nuke Downloads
· Add a Link
· New Files
· Top Rated
· Most Popular

Web Site Resources
· Nuke Sites
· Add A Site
· New Sites
· Top Rated
· Most Popular

Support
· NukeZone Hosting
· NukeSkins.com
· NukeForums.com
· phpnuke.org
· NukeFixes.com
Information
NukeForums
·PHPNuke 8 security worries
·PHP-Nuke SQL Injection Vulnerability Fix
·decompressing EN-Book-Nuke.tar.tar
·How to allow spaces/gaps/"-" in allowed usernames
·How to Setup PHPNUKE on win2k
·cannot save changes
·voting?
·Nuke forum picture problem
·How to change smtp port on wampserver and windows
·yet another 301 redirect problem

read more...
Top10 Links
· 1: Nuke Forums
· 2: PHPNukeFiles
· 3: NukeSkins
· 4: Nuke Templates
· 5: EcomJunk
· 6: MDesign
· 7: Windows Installation: PHP
· 8: FLASH-FOR-NUKE
· 9: Dezina
· 10: Global Dream News Sharing Portal!
Site Visitors
User Login:

Nickname:
Password:
Security Code: Security Code
Type Security Code Here:

Members List Membership:
Latest: GiLli
Today: 2
Yesterday: 1
Overall: 15104

Visitation:
Guests: 614
Members: 1
Total: 615


You are Anonymous user. You can register for free by clicking here
Sponsor Links
Need to find your IP fast?
Need to find your IP fast?

NukeResources :: View topic - [SOLVED] Profile Photo Modification display problem
NukeResources Forum Index

NukeResources Forum Index -> Upgrading PHP-Nuke -> [SOLVED] Profile Photo Modification display problem
Post new topic  Reply to topic    View previous topic :: View next topic 
[SOLVED] Profile Photo Modification display problem
PostPosted: Sat Jul 21, 2007 8:01 pm Reply with quote
chadrt
Resource Seeker
Resource Seeker
 
Joined: Feb 16, 2006
Posts: 14




I have done some modifications to the profile display and update pages and I have a little problem with getting a photo to display properly. I need to be able to set a photo when there is one and have it display a text message when there is not. I will show below what I have so far and the problems I am having.

Added to modules/Forums/includes/usercp_viewprofile.php
Code:

if ($profiledata['user_photo']==''){
$user_photo = 'No user provided photo exists!';
}else{
$user_photo = '~img src='images/userphotos/" . $profiledata['user_photo'] "'~';
}


Replace the ~ with < > respectively. That snippet causes the page to come up empty, not blank but empty, however if there is no user photo in the DB it works just as planned. Then if I change it to this to test:

Code:
if ($profiledata['user_photo']==''){
$user_photo = 'No user provided photo exists!';
}else{
$user_photo = '~img src='images/userphotos/ki4mve.jpg'>';
}


I get a photo but that would display my photo everytime that woulnt work. I need to somehow pass a varriable to the img tag to display the proper photo of whatever is stored in the database field user_photo only when that field is populated. Any ideas would be great.

I have already modified the .tpl for the profile display and all my other fields are displaying fine but they dont exactly need if/else to control data display.


Last edited by chadrt on Sun Jul 22, 2007 4:49 am; edited 1 time in total
View user's profile Send private message
PostPosted: Sat Jul 21, 2007 8:42 pm Reply with quote
chadrt
Resource Seeker
Resource Seeker
 
Joined: Feb 16, 2006
Posts: 14




It's WORKING yeah for me... I am no PHP expert and should really not be attempting these kind of changes but where would I be without at least trying.

Code:

if ($profiledata['user_photo']==''){
$user_photo = 'No user provided photo exists!';
}else{
$userpic = $profiledata['user_photo'];
$picpath = 'images/userphotos/';
$user_photo = '~img src="' . $picpath . $userpic . '"~';
}


Again replace the ~ with <or> respectively. But that was my solution to the problem I dont know why that would not work by joining text and a variable maybe someone here can show me what I did wrong. But I at least had to experiment and read a bit just so I could learn.
View user's profile Send private message
PostPosted: Sun Jul 22, 2007 12:49 am Reply with quote
Evaders99
Resource Master
Resource Master
 
Joined: May 25, 2004
Posts: 1785




Your first bit of code was missing a . (period) .. so it was incorrect syntax and would not parse. Also a missing end double-quote. Thus the blank page

Quote:

$profiledata['user_photo'] . "'~'";

_________________
- Star Wars Rebellion Network - Evaders Squadron Coding -

Need help? Nuke Patched Core, Coding Services, Webmaster Services
View user's profile Send private message Visit poster's website AIM Address
PostPosted: Sun Jul 22, 2007 4:38 am Reply with quote
chadrt
Resource Seeker
Resource Seeker
 
Joined: Feb 16, 2006
Posts: 14




Quote:

$profiledata['user_photo'] . "'~'";


That would make it:
Quote:

$user_photo = '~img src='images/userphotos/" . $profiledata['user_photo'] . "'~'";


Which dosent seem right I thought you had to start and end with the same character example "< + >" would be ok but "< + >' would not be ok? I am at another stand still using the same exact thing as I just went thru up top but using the $userinfo located in a mod I am doing with the Your_Account module so I can see, change, and delete the profile photo. No matter what I do the photo wont display. If I place a single img tag it works but not if I add the if/else statements in there to control the output. Here it is for index.php in Your_Account module:

Code:
if ($userinfo['user_info']==''){
        echo "This is no photo on file for your profile use the utilities to the left to add one!";
        }else{
        echo "~img src=images/userphotos/".$userinfo['user_photo'] .">";
        }


If I echo only the img tag it displays perfectly but this just shows the "There is no photo" error and thats it. Even thought it is definately populated if I echo just the $userinfo['user_photo'] above, below or both it shows up perfectly so the if should see something there and process else correct?
View user's profile Send private message
PostPosted: Sun Jul 22, 2007 4:49 am Reply with quote
chadrt
Resource Seeker
Resource Seeker
 
Joined: Feb 16, 2006
Posts: 14




Never mind that was probably the most retarded post I have ever made in a forum in my life. That was just plain not paying attention...
View user's profile Send private message
[SOLVED] Profile Photo Modification display problem
 NukeResources Forum Index -> Upgrading PHP-Nuke
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT - 4 Hours  
Page 1 of 1  

  
  
 Post new topic  Reply to topic     



Powered by phpBB © 2001-2005 phpBB Group.     Theme created by Vjacheslav Trushkin.
There have been 135 unique hit(s) in the past 24 hours.
Forums ©
Download the Best Archiver in the World


Best viewed with a Browser
All logos and trademarks in this site are property of their respective owner.
The comments are property of their posters, all the rest © 2001 - 2007 by NukeResources.com
You can syndicate our news using the file .backend.php or ultramode.txt
PHP-Nuke Copyright © 2004 by Francisco Burzi. This is free software, and you may redistribute it under the GPL. PHP-Nuke comes with absolutely no warranty, for details, see the license.
Page Generation: 0.27 Seconds

:: Eos phpbb2 style by Cyberalien :: PHP-Nuke theme by www.nukemods.com ::