login | register
Wed 08 of Oct, 2008 (11:06 UTC)

bitweaver - Web Application Framework and CMS

Web Application Framework and CMS

Refresh cacheRSS feed

Developer's FAQ

A list of common questions asked on IRC (with answers) that should be documented somewhere. :)

Created by: Stephan Borg, Fri 01 of Jul, 2005 (10:10 UTC)
Last modified: Thu 23 of Aug, 2007 (10:42 UTC)
find in entriesSearch  
Refresh cachePrint

How to test a user is logged in?

By sylvie
Tuesday 02 of May, 2006
Posted to Developer's FAQ
In php:
if( $gBitUser->isRegistered() )
In smarty:
{if $gBitUser->isRegistered()}
Refresh cachePrint

In smarty, how to do a link to another package?

By sylvie
Tuesday 02 of May, 2006
Posted to Developer's FAQ
Refresh cachePrint

How do I create a LibertyContent Class?

By Stephan Borg
Thursday 29 of December, 2005
Posted to Developer's FAQ
Your best bet to creating a LibertyContent class, is to copy the SamplePackage, BitSample.php file and modify accordingly.

The best approach is to:
  • Modify the verify() function first, making sure each and every field is validated correctly.
  • Modify the store() function, ensuring data is stored in the table correctly.
  • Modify the load() function
  • Modify the getList() function
  • Modify the expunge() function
Refresh cachePrint

Can I use strtotime() and strftime()?

By Stephan Borg
Thursday 29 of December, 2005
Posted to Developer's FAQ
We have implement locale timezone formatting using BitDate() class.

For easy access, always use:
$gBitSystem->mServerTimestamp->strtotime(...);
 
and
 
$gBitSystem->mServerTimestamp->strftime(...);
 
as straight replacements.


Inside Smarty templates, use the:
{$timestamp|bit_short_datetime}


Other formats are:
  • bit_date_format
  • bit_long_datetime
  • bit_short_date
  • bit_short_time
  • bit_long_date
  • bit_long_time
  • bit_short_datetime
Refresh cachePrint

Can I use strtotime() and strftime()?

By Stephan Borg
Thursday 29 of December, 2005
Posted to Developer's FAQ
We have implement locale timezone formatting using BitDate() class.

For easy access, always use:
$gBitSystem->mServerTimestamp->strtotime(...);
 
and
 
$gBitSystem->mServerTimestamp->strftime(...);
 
as straight replacements.


Inside Smarty templates, use the:
{$timestamp|bit_short_datetime}


Other formats are:
  • bit_date_format
  • bit_long_datetime
  • bit_short_date
  • bit_short_time
  • bit_long_date
  • bit_long_time
  • bit_short_datetime
Refresh cachePrint

Are there any multi-lingual aspects of bitweaver

By MsTeryGuest
Tuesday 16 of August, 2005
Posted to Developer's FAQ
Gleaned from irc:

Q. Are there any multi-lingual aspects of bitweaver

A. In short, wrap strings in smarty tpl's with some text and in your php, use the tra( 'some text' );. String collection is automatic as is translation

Q. how does it get translated?

A. lookup tables using md5( 'some text' ) as the master key. Translations are all cached to file system in single strings
Refresh cachePrint

How do I reference an icon?

By Stephan Borg
Saturday 06 of August, 2005
Posted to Developer's FAQ
All icons are stored under /icons directory.

For detailed information on biticon see function_biticon

{biticon ipackage='sheets' iname='icn_budgetgraph' iexplain='Graph'}
Refresh cachePrint

Is there an easy way to update data to a DB table?

By Stephan Borg
Friday 15 of July, 2005
Posted to Developer's FAQ
If you had a simple table, say:{code}'my_faq' => "
faq_id I4 AUTO PRIMARY,
question C(255) NOTNULL,
answer C(255) NOTNULL,
",{/code}

And you wanted to update a record, you would prepare the data to update in the following array:{code}$my_data = array(
'question' => "What is this project again?",
'answer' => "Its the Bitweaver CMS and Application Framework!",
);{/code}

Next, you would define what record you plan to update. You do this by building a search array.{code}$my_id = ar…
Refresh cachePrint

Is there an easy way to insert data to a DB table?

By Stephan Borg
Friday 15 of July, 2005
Posted to Developer's FAQ
If you had a simple table, say:
'my_faq' => "
	faq_id I4 AUTO PRIMARY,
	question C(255) NOTNULL,
	answer C(255) NOTNULL,
",


And you wanted to insert a record, you would prepare the data in the following array:
$my_data = array(
	'question' => "What is this project?",
	'answer' => "Its Bitweaver Application Framework!",
);


Then to insert it into the database:
$gBitDb->associateInsert( 'my_faq', $my_data );
Refresh cachePrint

I have a user ID, how do I get information about the user?

By Stephan Borg
Sunday 03 of July, 2005
Posted to Developer's FAQ
Well, in Smarty templates, using the {displayname} tag works a treat. For example, I have a user ID and I want their real name:
The user name is {displayname user_id=$gBitUser->getUserId()}


See Smarty Functions for more short-cut functions.