seesoe seesoe
  • Just popping in
  • Just popping in
  • Joined: 2007/1/2 23:42
  • Group: Registered Users
  • Posts: 33
  • Posted on: 2009/11/23 2:00
accessing database from theme.html #1
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
kris_fr kris_fr
  • Theme Designer
  • Theme Designer
  • Joined: 2005/12/30 19:15
  • From Bretagne
  • Group: Registered Users
  • Posts: 1009
  • Posted on: 2009/11/23 4:16
Re: accessing database from theme.html #2
hi,

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

@+
seesoe seesoe
  • Just popping in
  • Just popping in
  • Joined: 2007/1/2 23:42
  • Group: Registered Users
  • Posts: 33
  • Posted on: 2009/11/23 9:54
Re: accessing database from theme.html #3
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?
red_Slider red_Slider
  • Quite a regular
  • Quite a regular
  • Joined: 2006/1/4 11:26
  • Group: Registered Users
  • Posts: 248
  • Posted on: 2009/11/23 10:08
Re: accessing database from theme.html #4
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}>
Dylian Dylian
  • Friend of XOOPS
  • Friend of XOOPS
  • Joined: 2007/7/21 4:48
  • From Heerlen, Limburg, The Netherlands
  • Group: Registered Users
  • Posts: 237
  • Posted on: 2009/11/23 20:57
Re: accessing database from theme.html #5
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
How to effectively post a question in the Xoops forums? - Read here...
Design by: XOOPS UI/UX Team