1
seesoe
accessing database from theme.html
  • 2009/11/23 7:00

  • seesoe

  • Just popping in

  • Posts: 33

  • Since: 2007/1/3 4


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

2
kris_fr
Re: accessing database from theme.html
  • 2009/11/23 9:16

  • kris_fr

  • Theme Designer

  • Posts: 1009

  • Since: 2005/12/31



3
seesoe
Re: accessing database from theme.html
  • 2009/11/23 14:54

  • seesoe

  • Just popping in

  • Posts: 33

  • Since: 2007/1/3 4


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?

4
red_Slider
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}>

5
Dylian
Re: accessing database from theme.html
  • 2009/11/24 1:57

  • Dylian

  • Friend of XOOPS

  • Posts: 237

  • Since: 2007/7/21


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

Login

Who's Online

189 user(s) are online (105 user(s) are browsing Support Forums)


Members: 0


Guests: 189


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Mar 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits