Mysidia Adoptables Support Forum  

Home Community Mys-Script Creative Off-Topic
Go Back   Mysidia Adoptables Support Forum > Mysidia Adoptables > Questions and Supports

Notices

Reply
 
Thread Tools Display Modes
  #1  
Old 12-19-2016, 07:07 PM
bisexuowl bisexuowl is offline
x3 furry trash x3
 
Join Date: Sep 2015
Location: California
Posts: 22
Gender: Male
Credits: 4,618
bisexuowl is on a distinguished road
Default Put "FavPet" in a Smarty template based sidebar?

so i'm designing my own theme and so far it's been really fun! however, i have realized i have no clue how to grab the favpet id from the database to assign it in the class_template.php. i've tried just "$this->assign("favpet",$mysidia->user->profile->favpet)", i've tried "$favpet = mysql_query("SELECT 'favpet' FROM 'aetherwisps_1'.'aw1_users_profile' WHERE 'uid' = '{$uid}'");", and i think i tried one more thing but i don't remember.
Reply With Quote
  #2  
Old 12-19-2016, 07:52 PM
Hall of Famer's Avatar
Hall of Famer Hall of Famer is offline
Administrator, Lead Coder
 
Join Date: Dec 2008
Location: South Brunswick
Posts: 4,448
Gender: Male
Credits: 327,384
Hall of Famer is on a distinguished road
Default

Well first of all, never use mysql_query. Its been considered a terrible practice being procedural, insecure and outdated. Latest PHP versions already remove mysql_ functions, you should use $mysidia->db for Mysidia Adoptables. Or alternatively, try PDO if you dont want to use $mysidia->db or do not have access to it.
__________________


Mysidia Adoptables, a free and ever-improving script for aspiring adoptables/pets site.
Reply With Quote
  #3  
Old 12-19-2016, 08:30 PM
bisexuowl bisexuowl is offline
x3 furry trash x3
 
Join Date: Sep 2015
Location: California
Posts: 22
Gender: Male
Credits: 4,618
bisexuowl is on a distinguished road
Default

at the risk of sounding silly, how do i use $mysidia->db properly? i was new to coding a few months ago and took a break and now i'm totally lost again ;n;
Reply With Quote
  #4  
Old 12-19-2016, 08:54 PM
Dinocanid's Avatar
Dinocanid Dinocanid is offline
Member
 
Join Date: Aug 2016
Location: Maryland, USA
Posts: 516
Gender: Unknown/Other
Credits: 63,617
Dinocanid is on a distinguished road
Default

This guide has a section on how to use it:
https://docs.google.com/document/d/1...=h.7kcho2wxopx
It's the part that says "database sql statements"
__________________
Reply With Quote
  #5  
Old 12-19-2016, 09:29 PM
bisexuowl bisexuowl is offline
x3 furry trash x3
 
Join Date: Sep 2015
Location: California
Posts: 22
Gender: Male
Credits: 4,618
bisexuowl is on a distinguished road
Default

thanks for the help! i think i'm on the right track now, i've gotten it to half work and i think i can figure out the rest. :3
Reply With Quote
  #6  
Old 12-20-2016, 08:30 AM
Hall of Famer's Avatar
Hall of Famer Hall of Famer is offline
Administrator, Lead Coder
 
Join Date: Dec 2008
Location: South Brunswick
Posts: 4,448
Gender: Male
Credits: 327,384
Hall of Famer is on a distinguished road
Default

Note you may not be able to use $mysidia->db directly in a template .tpl file, it is available in any PHP files by calling $mysidia = Registry::get("mysidia"); You may want to fetch all favorite pets data from database, assign them as array or other collection types in smarty template, and then use the collection in smarty template.
__________________


Mysidia Adoptables, a free and ever-improving script for aspiring adoptables/pets site.
Reply With Quote
Reply

Tags
mysidia 1.3.4, sidebar, smarty template

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 08:09 AM.

Currently Active Users: 438 (0 members and 438 guests)
Threads: 4,080, Posts: 32,024, Members: 2,016
Welcome to our newest members, jolob.
BETA





What's New?

What's Hot?

What's Popular?


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
vBCommerce I v2.0.0 Gold ©2010, PixelFX Studios
vBCredits I v2.0.0 Gold ©2010, PixelFX Studios
Emoticons by darkmoon3636