/    Sign up×
Community /Pin to ProfileBookmark

print message for people with private images

i want to print text is aperson has a private image

The following function has two important parts;

GetDefaultPic($ID, 1, $connector);

ID = is the member id
1 = private image/ 0 = public

This function will only return a result for the image therefore if i want a yes/no i will need to make a function

could i say

how do i make afunction that will print a statement say: <?php
print(“this member has private images”);?>

if a member has a private image?

to post a comment
PHP

4 Comments(s)

Copy linkTweet thisAlerts:
@patenaudematOct 11.2006 — Perhaps something like this is what you're looking for?

[code=php]<?php
function GetDefaultPic($ID, $private, $connector) {

/* Your function can do whatever you want here */

if ($private) { // checks to see if $private is true
echo "This user has private images.";
}
}
?>[/code]


Hope it helps!

-Matt
Copy linkTweet thisAlerts:
@wilburforceauthorOct 12.2006 — Great exactly what i want, cheers
Copy linkTweet thisAlerts:
@wilburforceauthorOct 12.2006 — there is a box with users details i have added code but it print nothing

$ID= $row['userid'];

$GENDER= $row['gender'];

$AGE = substr($AGE, 0, 2);

$NAME= $row['username'];

$DATE= $row['login_date'];

$TIME= $row['login_time'];

$COUNTER_USER_HITS = $row['hits'];

if(isset($row['zipcode'])){$USR_ZIPCODE=$row['zipcode'];}

if(isset($row['postcode'])){$USR_POSTCODE=$row['postcode'];}

if ($private) {print "This user has private images."; }
Copy linkTweet thisAlerts:
@patenaudematOct 12.2006 — You probably first need something like:

[code=php]$private = $row['private'];[/code]

... first in order to set the $private variable to the value you desire. You might also consider:

[code=php]$private = (int)$row['private'];[/code]

This will ensure that $private is set to an integer value, not a string (shouldn't be a problem, but just in case ?).

-Matt
×

Success!

Help @wilburforce spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...