Fork me on GitHub
Get XOOPS XOOPSXOOPS FAQFAQ ForumsForums NewsNews ThemesThemes ModulesModules
New Posts New Topics All Posts All Forums Index General Modules Themes Development International XOOPS.org

Search

Nominate XOOPS!

Learn XOOPS Core

Donat-O-Meter

Make donations with PayPal!
Stats
Goal: $100.00
Due Date: Jul 31
Gross Amount: $15.00
Net Balance: $14.11
Left to go: $85.89

Donations
Anonymous ($15)Jul-20

Local Support

Advertisement

XOOPS Code hosted on SourceForge

Cumulus Tag Cloud

- 2 2.5 2.6 3.0 4 6 2013 Abuse adslight Android AntiHarvesting AntiMalUser AntiSpam API Apple Battlefield billige Bootstrap Captcha cell cent chronolabs CHUNG content CĂN demo docek download Dresses evden eve facebook Fat floor Food for free Gateway Google Guide herre Home Honeypot HP Human HỘ IP iPhone jQuery Language List log Loss mobile module modules Monster new newbb news NHÀ online PARK phone PHP Prevention profile project Protector publisher Rapid RESIDENCE responsive review Rights rmcommon Room security Sentry site Smartphone Solution Spam Studio tags tdmcreate template The Theme themes User userlog web weight Wishcraft xoops Xortify

New Users

Registering user

# 137619

bhpstr

Welcome to XOOPS!




Bottom   Previous Topic   Next Topic  Register To Post



#1 Posted on: 2009/11/23 1:00 accessing database from theme.html
hello, i am working on an embedded marquee that has user profile avatars. im trying to use the XOOPS system to access the user_avatar fields of users from the user table

im working within the theme.html file, is there a way to do this with smarty?

or would it just be easier if i write some php code and embed it within the theme.html page? (didn't really want to do this because the php code is displayed in normal text when viewing. (in regards for the database access info))

if anything is there a way to include some file in the theme.html that will connect to the database?

thanks
cheers
seesoe

Top

seesoe
Just popping in
Just popping in
Joined:
2007/1/2 22:42
Group:
Registered Users
Posts: 33
(Show More) (Show Less)


#2 Posted on: 2009/11/23 3:16 Re: accessing database from theme.html
hi,

look here --> http://www.frxoops.org/modules/newbb/ ... t_id=82400#forumpost82400

@+

Top

kris_fr
Theme Designer
Theme Designer
Joined:
2005/12/30 18:15
From Bretagne
Group:
Registered Users
Posts: 800
(Show More) (Show Less)


#3 Posted on: 2009/11/23 8:54 Re: accessing database from theme.html
Hmmm not exactly what I'm after, Im looking to be able to get all the user avatars from the user table If not blank.gif then echo the file name of the avatar


Which system php file could I modify so that when avatar filenames are renamed on upload I can put a prefix on the file?

Top

seesoe
Just popping in
Just popping in
Joined:
2007/1/2 22:42
Group:
Registered Users
Posts: 33
(Show More) (Show Less)


#4 Posted on: 2009/11/23 9:08 Re: accessing database from theme.html
how about that in block system_block_topusers.html

<{if $user.avatar != ""}> <div class="center"> <table>     <tbody>         <tr>             <td style="height: 50px; vertical-align: bottom;"><a title="<{$user.name}>" href="<{$xoops_url}>/userinfo.php?uid=<{$user.id}>"><img width="40" alt="<{$user.name}>" src="<{$user.avatar}>" /></a></td>         </tr>         <tr>             <td><a title="<{$user.name}>" href="<{$xoops_url}>/userinfo.php?uid=<{$user.id}>"><span class="forum_desc"><{$user.name}> <br />(<{$user.posts}>)</span></a></td>         </tr>      </tbody> </table> </div> <{else}> <div class="center"> <table>     <tbody>         <tr>             <td style="height: 50px; vertical-align: bottom;"><a title="<{$user.name}>" href="<{$xoops_url}>/userinfo.php?uid=<{$user.id}>"><img width="40" alt="<{$user.name}>" src="<{$xoops_url}>/modules/profile/images/noavatar.gif" /></a></td>         </tr>         <tr>             <td><a title="<{$user.name}>" href="<{$xoops_url}>/userinfo.php?uid=<{$user.id}>"><span class="forum_desc"><{$user.name}> <br />(<{$user.posts}>)</span></a></td>         </tr>      </tbody> </table> </div> <{/if}> <{/table_foreach}>


Top

red_Slider
Quite a regular
Quite a regular
Joined:
2006/1/4 10:26
Group:
Registered Users
Posts: 243
(Show More) (Show Less)


#5 Posted on: 2009/11/23 19:57 Re: accessing database from theme.html
I have made a hack to do what you wan't, here's how to do it:

Step 0:
Download the avatarScroller package.
Step 1:
Upload the avatarScroller directory in the package to your XOOPS upload folder. (xoops_root/uploads)
Step 2:
Open xoops_root/header.php in your favorite editor and search for the line:
$xoopsTpl =& $xoTheme->template;

and replace it with:
$xoopsTpl =& $xoTheme->template;
include(
XOOPS_ROOT_PATH.'/uploads/avatarScroller/avatarScroller.php');

save/upload the edited header.php /
Step 3:
Place the smarty tag <{$avatar_scroller}> in your theme/template/block where you want to display the avatar scroller.

NOTE: jquery is needed for this hack to work! If you dont have jquery included in your theme please open avatarScroller/avatarScroller.php and follow the instructions.

Greets Dylian.

BTW To change the looks of the scroller edit avatarScroller/avatarScroller.js and avatarScroller/avatarScroller.css

Top

Dylian
Friend of XOOPS
Friend of XOOPS
Joined:
2007/7/21 3:48
From Heerlen, Limburg, The Netherlands
Group:
Registered Users
Posts: 202
(Show More) (Show Less)







You can view topic.
You cannot start a new topic.
You cannot reply to posts.
You cannot edit your posts.
You cannot delete your posts.
You cannot add new polls.
You cannot vote in polls.
You cannot attach files to posts.
You cannot post without approval.
You cannot use topic type.
You cannot use HTML syntax.
You cannot use signature.

[Advanced Search]