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
 BF3 Stats
 Forums
 News
 Downloads
 News Letter
 Video tutorials
 Supporters
 Uploads
 F.A.Q
· FAQ
· Docs
· Forums FAQ
 [HS] History
 PHP Nuke Tools
 WhoIS Lookup
 Site Map
 Write a Review
 Image Repo
 Logout
DFG
DFG DFG DFG

 
[HSX] Donations
 
DFG
Donation
This here is a combined total of what we need to keep us going each month.

0 %

Donate

End DateApr 01
Target$50.00
Below Target$50.00
CurrencyUSD

Donators This Month
DFG
DFG DFG DFG

 
 Search our Site
 
DFG DFG
DFG DFG DFG

 
Theme Management
 
DFG


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 749
Comments: 0
DFG
DFG DFG DFG

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

DFG
DFG DFG DFG

     
DFG HeadShot Extreme :: View topic - Some Coding Help??


Search for at
HeadShot Extreme Advanced Search

Some Coding Help??
Post new topic   Reply to topic   printer-friendly view   Thank Post    HeadShot Extreme Forum Index -> Nuke Blocks / Modules Support
View previous topic :: View next topic  
Author Message
Sp0rAdiC

NOOB!!!
NOOB!!!





This user has donated to the clan.



  • » Show Info «


Status: Sp0rAdiC is offline
PostPosted: Mon Oct 03, 2016 7:48 am Post subject: No icon Some Coding Help?? Reply with quote

I'm messing around with a chat program.

PHP:
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.....
Back to top
View user's profile Send private message Visit poster's website
HeadShot Domain, Been in buisness for over 10 years...
[HSX]coRpSE

Top Dog
Top Dog
Nuke Dev / Coder
Nuke Dev / Coder



Clan Leader


This user has donated over $300 to the clan.


Offline
  



  • » Show Info «


Status: coRpSE is offline
PostPosted: Mon Oct 03, 2016 9:55 am Post subject: No icon Re: Some Coding Help?? Reply with quote

Are you looking for username or their id?

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

PHP:
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:
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
Back to top
View user's profile Send private message Visit poster's website
HeadShot Domain, Been in buisness for over 10 years...
Sp0rAdiC

NOOB!!!
NOOB!!!





This user has donated to the clan.



  • » Show Info «


Status: Sp0rAdiC is offline
PostPosted: Mon Oct 03, 2016 11:34 am Post subject: No icon Re: Some Coding Help?? Reply with quote

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..


 
Back to top
View user's profile Send private message Visit poster's website
HeadShot Domain, Been in buisness for over 10 years...
Sponsor
[HSX]coRpSE

Top Dog
Top Dog
Nuke Dev / Coder
Nuke Dev / Coder



Clan Leader


This user has donated over $300 to the clan.


Offline
  



  • » Show Info «


Status: coRpSE is offline
PostPosted: Mon Oct 03, 2016 12:19 pm Post subject: No icon Re: Some Coding Help?? Reply with quote

that's not hard,

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

Something like this should work.
PHP:
$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:
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:
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.


 
Back to top
View user's profile Send private message Visit poster's website
HeadShot Domain, Been in buisness for over 10 years...
Sp0rAdiC

NOOB!!!
NOOB!!!





This user has donated to the clan.



  • » Show Info «


Status: Sp0rAdiC is offline
PostPosted: Mon Oct 03, 2016 12:40 pm Post subject: No icon Re: Some Coding Help?? Reply with quote

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:
/* 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...


 
Back to top
View user's profile Send private message Visit poster's website
HeadShot Domain, Been in buisness for over 10 years...
Display posts from previous:
Post new topic  Reply to topic   printer-friendly view   Thank Post HeadShot Extreme Forum Index ->  Nuke Blocks / Modules Support All times are UTC - 7 Hours [DST enabled]
Page 1 of 1
 


 
Jump to:  
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

Related topics
 Topics   Replies   Author   Views   Last Post 
No new posts Announcement: To help me with voting on new members... 0 StoneSoldier 1715 Fri Nov 09, 2012 11:11 pm
StoneSoldier View latest post
This topic is locked: you cannot edit posts or make replies. Sticky: **New Rule for the Streaming Chat channel on TS3** 0 coRpSE 338 Fri Sep 01, 2017 10:27 pm
coRpSE View latest post
No new posts Master Coders needing help here. 2 Ruphus 1295 Mon Dec 08, 2014 8:39 am
coRpSE View latest post
No new posts [ Poll ] I need your help 14 coRpSE 2801 Sun Jun 03, 2012 9:19 am
SCooBY_XI View latest post
No new posts Who needs help with the IS 4 grind. 1 Jedi-Jack 1116 Tue May 01, 2012 3:12 pm
StoneSoldier View latest post
 




Powered By: phpBB © 2001 - 2008 phpBB Group
SimpleBlack V2 By: killigan
© DarkForge Graphics 2008 - 2009 All Rights Reserved

Googlepage: GooglePullerPage
DFG
DFG DFG DFG
Forums ©
Copyright © HeadShotDomain 2016 By: coRpSE
SimpleBlack V2 By: Killigan
Powered By: Evolution-Xtreme