292411
gstarrett
Re: "Best" place to put custom theme functions?
  • 2003/7/20 23:45

  • gstarrett

  • Friend of XOOPS

  • Posts: 174

  • Since: 2002/3/12


Quote:
chapi wrote:
As XOOPS uses smarty you should also be able to include some php files with it. Look at the following site for more information on this topic ...

http://smarty.php.net/manual/en/language.function.include.php.php


Follow-up:

The include_php function requires an absolute path to the PHP file. That's a bit cumbersome when you're dealing with win32 dev and RH8 prod. I couldn't seem to find any way to get the template's directory pre-pended to the include file (XOOPS vars unavailable, smarty vars not set??)

However, the {php} directive does work as advertised and allows me to accomplish what I wanted. The downside is I need to include the PHP code in my template--less than ideal.

I suppose it's possible the XOOPS vars are available within the smarty PHP block but I didn't check that.

Here's how I included the PHP code in my template, in case anyone wants to try it with theirs.

...
<{
php}>
// Include theme-specific functions
function dt_AZtime() {
    
# Calculate current AZ time -- Server is not in MST time zone
    # offset to server = -7h - (server offset)
    
$MST_to_Server_offset = -60 60 date"Z" );
    return 
time() + $MST_to_Server_offset;
}
    
    
$this->assign('theme_localtime'date"g:ia,  F j, Y"dt_AZtime()));
<{/
php}>

  <
table cellspacing="0">
...
      <
td id="headerbar"><a href="<{$xoops_url}>/">GAPT</a>: <{$xoops_pagetitle}></td>
      <
td id="headerbar-right"><{$theme_localtime}></td>
...


P.S. Many thanks to Chapi to pointing me to the Smarty site and getting me headed in the right direction.



292412
double1
Re: Autologin - does it update xoopsmembers "last login date"
  • 2003/7/20 22:59

  • double1

  • Just popping in

  • Posts: 8

  • Since: 2003/4/26


Hi Beyond

Thank you VERY VERY much! Your solution is exactly what I was looking for! I've waited a bit before replying, to test the modification over some days, but no problems whatsoever, excellent.

Thanks again, you really made my day. I wish I could by you a beer

Best regards,

Ross



292413
gstarrett
Re: "Best" place to put custom theme functions?
  • 2003/7/20 21:41

  • gstarrett

  • Friend of XOOPS

  • Posts: 174

  • Since: 2002/3/12


Thanks!! That's exactly what I was hoping to find.





292414
chapi
Re: "Best" place to put custom theme functions?
  • 2003/7/20 21:30

  • chapi

  • Theme Designer

  • Posts: 611

  • Since: 2002/1/22


As XOOPS uses smarty you should also be able to include some php files with it. Look at the following site for more information on this topic ...

http://smarty.php.net/manual/en/language.function.include.php.php



292415
ackbarr
Re: "Best" place to put custom theme functions?

since an XOOPS theme is really nothing more than a template displaying variables supplied by the XOOPS core and modules, I think your only option is a core hack. However you can isolate these functions into a seperate file and include the file into /common.php, thus minimizing the core modifications necessary and simplifying their removal if needed.

You will also need to assign the function returns to smarty variables for your theme to utilize them. For examples of how to assign variables to the smarty engine, take a look at the module kickstart guide.



292416
gstarrett
Re: "Best" place to put custom theme functions?
  • 2003/7/20 18:29

  • gstarrett

  • Friend of XOOPS

  • Posts: 174

  • Since: 2002/3/12


Anyone have any ideas? I'm hoping someone can provide some guidance, or perhaps tell me I'm heading down a track that "isn't done because...".

Anyone?

Thanks!



292417
Daigoro
Re: SOLVED - Making Xoops CONTENT Multilingual *Fixed Code Quote problem*
  • 2003/7/20 17:17

  • Daigoro

  • Quite a regular

  • Posts: 223

  • Since: 2003/7/3 2


Hsalazar,
Thanks. Later tonight I'll try to change the pagetitle according to your description.
I'll also try to catch up on my php skills (afterall, it's just yet another language to learn), so I will be able to hack other modules like you have done. IF I succeed, I'll post the functionality here.

Best regards!



292418
DobePhat
Re: Forum Not Selected
  • 2003/7/20 16:01

  • DobePhat

  • Friend of XOOPS

  • Posts: 656

  • Since: 2003/4/15


Hmmmmmm, I cant figure this one out, the info above is useless, Im wondering if the viewtopic.PHP is bad or what, the script was created in April,
Anyways, using upgraded 2.02 (03),and Globals OFF, Win2k
. I read somewhere this issue was fixed with the new version, but it is not...at least the patch didnt fix it...wondering if there was a file that changed related to this query and variable for "forum not selected".



292419
DobePhat
Re: NewBB Problem?
  • 2003/7/20 1:56

  • DobePhat

  • Friend of XOOPS

  • Posts: 656

  • Since: 2003/4/15


Warning: Cannot modify header information - headers already sent by (output started at "drive":\dir\theatreport\include\common.php:140) in "drive":\dir\theatreport\modules\newbb\viewtopic.php on line 349

This is the only thing I can get , though its tricky to logout then log in with php debugger on.
A bit frusterating, as users would like to log in without getting "kicked" to the forum start



292420
knight
Re: X2 NewBB: QuickReply Form
  • 2003/7/20 1:38

  • knight

  • Just popping in

  • Posts: 29

  • Since: 2002/12/29


just notice one bug, it can actually can reply the post which been lock







Login

Who's Online

197 user(s) are online (125 user(s) are browsing Support Forums)


Members: 0


Guests: 197


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