Welcome to the [HSX] website!

Been Gaming since 2003

Community Driven Site

Gaming, Web Development, and Support

  

 
Main Menu
 
DFG
 Home
 Join our Clan
 [HSX] Roster
 Forums
 News
 Downloads
 News Letter
 Video tutorials
 Supporters
 Uploads
 F.A.Q
· FAQ
· Docs
· Forums FAQ
 [HS] Timeline
 Site Map
 Write a Review
 Image Repo
 WhoIs
 Twitch ID Finder
 Logout
DFG
DFG DFG DFG

 
[HSX] Donations
 
DFG
Total Donators
Total:
$0.00
Goal:
$30.00
Difference:
$30.00
DFG
DFG DFG DFG

 
Theme Management
 
DFG
DFG
DFG DFG DFG

 
Whos Been
 
DFG
 coRpSE
 3 hours ago
 EmeraldDragon
 4 hours ago
 PatPgtips
 18 hours ago
 fire
 23 hours ago
 bairdboy
 1 day ago
 Lonestar
 2 days ago
 Bulldog1
 2 days ago
 TheGhost
 2 days ago
 Grmm
 2 days ago
 2xTaz
 5 days ago
DFG
DFG DFG DFG

 
Survey
 
DFG What is your favorite game to play ATM?

WarThunder
World of Tanks
H1Z1
MechWarrior Online
ARK
WarFace
SWTOR
BattleField serier
COD Series
Diablo
Armored Warfare



Results
Polls

Votes 1528
Comments: 0
DFG
DFG DFG DFG

 
Honey Pot
 
DFG
Bots in the pot!
We have [2623] bots stopped!
HeadShotDomain
DFG
DFG DFG DFG

     
DFG
 
Forum Index Members Search Usergroups
Ranks Staff Statistics Forum FAQ
Board Rules Edit your profile Login, Check Messages Log in
 

Some Coding Help??
Post new topic Reply to topic printer-friendly view List users that have viewed this topic Thank Post Forum Index Nuke Blocks / Modules Support
View previous topic View next topic
PostPosted: Mon Oct 03, 2016 7:48 am Reply with quote
Sp0rAdiC
I'm messing around with a chat program.

PHP:  [ Select all ]

if(USER_IS_LOGGED_IN)

 
   $ses LOGGED_IN_USERID//tell freichat the userid of the current user

 
   setcookie("freichat_user""LOGGED_IN"time()+3600"/"); // *do not change -> freichat code
}
else {
 
   $ses null//tell freichat that the current user is a guest

 
   setcookie("freichat_user"nulltime()+3600"/"); // *do not change -> freichat code

 
How do set the if(USER_IS_LOGGED_IN)??
And how would I pull the user_id from database?

Ive been banging my head on this simple (I'm sure) code.....

NOOB!!!

Groups NOOB!!!
Posts 37
Joined Jul 03, 2013
Status Offline
Gender Male
View user's profile Send Sp0rAdiC a private message Visit user's website Find all posts by Sp0rAdiC

PostPosted: Mon Oct 03, 2016 9:55 am Reply with quote
coRpSE
Are you looking for username or their id?

because if you're looking for username, then you can do this,

PHP:  [ Select all ]

global $userinfo;

if(
is_user())

 
   $ses $userinfo['username']; //tell freichat the userid of the current user

 
   setcookie("freichat_user""LOGGED_IN"time()+3600"/"); // *do not change -> freichat code
}
else {
 
   $ses null//tell freichat that the current user is a guest

 
   setcookie("freichat_user"nulltime()+3600"/"); // *do not change -> freichat code

 
Now, if its for the user id number, then it would be like this.

PHP:  [ Select all ]

global $userinfo;

if(
is_user())

 
   $ses $userinfo['user_id']; //tell freichat the userid of the current user

 
   setcookie("freichat_user""LOGGED_IN"time()+3600"/"); // *do not change -> freichat code
}
else {
 
   $ses null//tell freichat that the current user is a guest

 
   setcookie("freichat_user"nulltime()+3600"/"); // *do not change -> freichat code

 
You do need to make sure you have that global. Mind you, this will only work if the rest of the system is integrated with the Evo CMS so you can use the globals.


Expand

Top Dog
Nuke Dev / Coder
Clan Leader
Groups Top Dog
Nuke Dev / Coder
Posts 2452
Joined Jan 12, 2012
Status Offline
View user's profile Send coRpSE a private message Visit user's website
coRpSE
Currently Offline
Offline

Most Played:
This week: 7.6hrs.
Total Played: 9.3hrs.


  
Are you really committed?
Find all posts by coRpSE

PostPosted: Mon Oct 03, 2016 11:34 am Reply with quote
Sp0rAdiC
Hey bud.  I do believe that got it working. Super Need to get some users on to test it, lol... It will actually pull the user's avatar also if I can figure that out..


 

NOOB!!!

Groups NOOB!!!
Posts 37
Joined Jul 03, 2013
Status Offline
Gender Male
View user's profile Send Sp0rAdiC a private message Visit user's website Find all posts by Sp0rAdiC

 
PostPosted: Mon Oct 03, 2016 12:19 pm Reply with quote
coRpSE
that's not hard,

again, it would be just using the global of userinfo.

Something like this should work.

PHP:  [ Select all ]

$userinfo['user_avatar']; 


Now, if I wanted to make it so all I needed to do is put a variable like $avatar in a certain place, then I would write it like this.

PHP:  [ Select all ]

global $userinfo;
if(
is_user()){ 

 
$avatar_image $userinfo['user_avatar']; 
 
   if (!empty($avatar_image)){
        
$avatar "./modules/Forums/images/avatars/".$avatar_image;
    }else{
        
$avatar "./modules/Forums/images/avatars/blank.gif"
    }

 
the way that is designed is if they are a user, it will check to see if the the avatar is empty, if its not, then it will show their avatar image. Now, if it is empty, it will show the avatar blank.gif. Of course, your going to want to make sure you have a blank.gif avatar. Like this one here is mine,
Expand

Pretty much that's how I would do it, and now, if I wanted to display that image anywhere on that page I have that coding on, all I would do is this.
I would place this code where I wanted to display the avatar,

PHP:  [ Select all ]

echo '<img src="'.$avatar.'" style="max-width: 80px; max-height: 80px;" alt="">'

 
As you can see, I used a max width and a max height instead of setting a width and height because overall, by doing it this way it will not distort the image in any way. That of course would have to be adjusted to the size of the avatar you want to be shown.

And that's it, hope this helps.


 

Top Dog
Nuke Dev / Coder
Clan Leader
Groups Top Dog
Nuke Dev / Coder
Posts 2452
Joined Jan 12, 2012
Status Offline
View user's profile Send coRpSE a private message Visit user's website
coRpSE
Currently Offline
Offline

Most Played:
This week: 7.6hrs.
Total Played: 9.3hrs.


  
Are you really committed?
Find all posts by coRpSE

PostPosted: Mon Oct 03, 2016 12:40 pm Reply with quote
Sp0rAdiC
There's a file called hardcode.php which handles all the sql db info.  It asks for a table and column where the avatar url is stored. I don't know if this is possible or if i would have to find where it sets the variable and code it with the path manually...

PHP:  [ Select all ]

/* Custom driver */
$usertable='nuke_users'//specifies the name of the table in which your user information is stored.
$row_username='username'//specifies the name of the field in which the user's name/display name is stored.
$row_userid='user_id'//specifies the name of the field in which the user's id is stored (usually id or userid)


$avatar_table_name='nuke_users'//specifies the table where avatar information is stored
$avatar_column_name='user_avatar'//specifies the column name where the avatar url is stored
$avatar_userid='user_id'//specifies the userid  to the user to get the user's avatar
$avatar_reference_user='username'//specifies the reference to the user to get the user's avatar in user table 
$avatar_reference_avatar='username'//specifies the reference to the user to get the user's avatar in avatar
$avatar_field_name=$avatar_column_name//to avoid unnecessary file changes , *do not change 

 
Obviously what I have set for the avatar is not correct, lol...


 

NOOB!!!

Groups NOOB!!!
Posts 37
Joined Jul 03, 2013
Status Offline
Gender Male
View user's profile Send Sp0rAdiC a private message Visit user's website Find all posts by Sp0rAdiC

Display posts from previous:
Post new topic Reply to topic printer-friendly view List users that have viewed this topic Thank Post All times are UTC - 7 Hours [DST enabled]
Page 1 of 1


 
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
You cannot attach files in this forum
You cannot download files in this forum

Powered by phpBB © 2001, 2019 phpBB Group
DFG
DFG DFG DFG
Forums ©
Copyright © HeadShotDomain 2016 By: coRpSE
SimpleBlack V2 By: Killigan
Powered By: Evolution-Xtreme