Fork me on GitHub



Make donations with PayPal!
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00

Learn XOOPS Core

Local Support


XOOPS Code hosted on SourceForge

Cumulus Tag Cloud

- 2 2.5 2.6 4 6 admin Android AntiHarvesting AntiSpam API Apple Battlefield Blocks Bootstrap Captcha cell cent chronolabs Clicks Cloud content CĂN demo download Dresses facebook Fat floor for free Gateway giải Google Guide herre Home Honeypot html5 Human HỘ IP iPhone jQuery Language Law Legal List Loss module modules Monster new newbb news nhiệt NHÀ online PARK Payment phone PHP Prevention profile project Protector publisher RESIDENCE responsive review Rights rmcommon Room security Sentry Signed site Smartphone Smarty Smoking Solution Spam stem Studio support tag tdmcreate The Theme themes User userlog web weight xoops Xortify XPayment ZendFramework

New Users

Registering user

# 138593


Welcome to XOOPS!

Bottom   Previous Topic   Next Topic  |  Register To Post

#1 Posted on: 2009/11/23 2: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?



2007/1/2 23:42
Registered Users
Posts: 33
(Show More) (Show Less)

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

look here --> ... t_id=82400#forumpost82400



2005/12/30 19:15
From Bretagne
Registered Users
Posts: 801
(Show More) (Show Less)

#3 Posted on: 2009/11/23 9: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?


2007/1/2 23:42
Registered Users
Posts: 33
(Show More) (Show Less)

#4 Posted on: 2009/11/23 10: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="<{$}>" href="<{$xoops_url}>/userinfo.php?uid=<{$}>"><img width="40" alt="<{$}>" src="<{$user.avatar}>" /></a></td>         </tr>         <tr>             <td><a title="<{$}>" href="<{$xoops_url}>/userinfo.php?uid=<{$}>"><span class="forum_desc"><{$}> <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="<{$}>" href="<{$xoops_url}>/userinfo.php?uid=<{$}>"><img width="40" alt="<{$}>" src="<{$xoops_url}>/modules/profile/images/noavatar.gif" /></a></td>         </tr>         <tr>             <td><a title="<{$}>" href="<{$xoops_url}>/userinfo.php?uid=<{$}>"><span class="forum_desc"><{$}> <br />(<{$user.posts}>)</span></a></td>         </tr>      </tbody> </table> </div> <{/if}> <{/table_foreach}>


2006/1/4 11:26
Registered Users
Posts: 243
(Show More) (Show Less)

#5 Posted on: 2009/11/23 20: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;

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


2007/7/21 4:48
From Heerlen, Limburg, The Netherlands
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.
You cannot create PDF files.
You cannot get print page.

[Advanced Search]