1
-DJNZ-
Re: getting all fileds from a table
  • 2005/7/31 16:56

  • -DJNZ-

  • Just popping in

  • Posts: 30

  • Since: 2005/1/11





2
-DJNZ-
Re: A small suggestion :: Security
  • 2005/7/31 16:22

  • -DJNZ-

  • Just popping in

  • Posts: 30

  • Since: 2005/1/11


.. or alternatively just put Options -Indexes in an .htaccess file in your web root.



3
-DJNZ-
Re: How to add SmartyMenu to Xoops?
  • 2005/5/2 1:42

  • -DJNZ-

  • Just popping in

  • Posts: 30

  • Since: 2005/1/11


Quote:

PS: there is an array'ed way to do the menus with Smarty also...

Thanks, I missed that when I read the info. And I got the other thing wrong too - well, I am glad it worked!



4
-DJNZ-
Re: How to add SmartyMenu to Xoops?
  • 2005/5/1 15:54

  • -DJNZ-

  • Just popping in

  • Posts: 30

  • Since: 2005/1/11


Quote:

juanjo wrote:
...theme.html does not have any php code at all!!

No, the whole point of using Smarty is that template files do not need PHP in them. But to do something like you want, it is possible to put PHP in a template as below - put this somewhere near the beginning of theme.html (just after the <html> tag would do). But IMHO this is not a very efficient way of putting a static menu on your site: there are just too many calls to SmartyMenu methods. If I was writing SmartyMenu I would have used an array for input.
<{php}>
    require_once(
'/path/to/where/you/put/it/SmartyMenu.class.php');
   
    
// initialize your menu
    
SmartyMenu::initMenu($menu);

    
// first menu item
    
SmartyMenu::initItem($item);
    
SmartyMenu::setItemText($item'Yahoo');
    
SmartyMenu::setItemLink($item'http://www.yahoo.com/');
    
SmartyMenu::addMenuItem($menu$item);
...    
    
$this->assign('smarty_menu'$menu); // for PHP code in a template the Smarty object is in $this
<{/php}>

Then you can just put <{$smarty_menu}> in the template where you want it to appear. Don't forget to put the link to the CSS file in <head> too.



5
-DJNZ-
Re: Title problem
  • 2005/5/1 10:53

  • -DJNZ-

  • Just popping in

  • Posts: 30

  • Since: 2005/1/11


This is a FAQ.

After include(XOOPS_ROOT_PATH."/header.php") you can change the title with:

$xoopsTpl->assign('xoops_pagetitle', 'Your Page Title');



6
-DJNZ-
Re: users online variable?
  • 2005/4/29 21:38

  • -DJNZ-

  • Just popping in

  • Posts: 30

  • Since: 2005/1/11


LOL answers are like buses - nothing for ages and then three all at once. There will be another one in a minute I bet.



7
-DJNZ-
Re: users online variable?
  • 2005/4/29 21:36

  • -DJNZ-

  • Just popping in

  • Posts: 30

  • Since: 2005/1/11


The number of users online is not generated by the core but you can use the code that the Users Online system block uses to generate it. This is a bit hacky and will give you more than you want, but in your template file try the following:
<{php}>
include_once 
'/path/to/xoops/modules/system/blocks/system_blocks.php';
$this->assign('users_online'b_system_online_show());
<{/
php}>
<{
$users_online.online_total}>



8
-DJNZ-
Re: Hotmail Users
  • 2005/4/10 1:29

  • -DJNZ-

  • Just popping in

  • Posts: 30

  • Since: 2005/1/11


Quote:

jctsup1 wrote:
Wouldn't this allow anyone from his ISP to send mail with forged headers?

Well yes, but as he doesn't have a fixed IP for his own domain, he has to route his email through some other domain's mail server and his ISP seems like the best choice. Every ISP would come down very hard on a user found forging another customer's mail headers, and it would be really easy to trace. Nothing stops anyone from sending mail with forged headers - SPF just makes that mail look like spam to SPF-aware spam filters.

Quote:

jctsup1 wrote:
Thank you for the information on this --- I have setup records for all my mail domains and hope this catches on in the industry.

Thanks for your comments. I have mixed feelings about SPF (seehttp://spf.pobox.com/objections.html), but with MSN/Hotmail and AOL demanding it, the objections are now irrelevent - if you want your email to get through, you need SPF.



9
-DJNZ-
Re: Auto select next available db user in mainfile.php
  • 2005/4/7 18:41

  • -DJNZ-

  • Just popping in

  • Posts: 30

  • Since: 2005/1/11


Quote:

Max-Realms wrote:
So is this impossible? Nope.
Or no-one knows how to do it. Sure they do.
Or just doesn't care... You guessed it!

I would guess that most XOOPS users use hosts where MySQL useage is not limited by MySQL user, so they don't care. If you would rather spend time hacking code than negotiating a better hosting arrangement then:

In function connect() in class/database/mysqldatabase.php, replace the following code
if (XOOPS_DB_PCONNECT == 1) {
    
$this->conn = @mysql_pconnect(XOOPS_DB_HOSTXOOPS_DB_USERXOOPS_DB_PASS);
} else {
    
$this->conn = @mysql_connect(XOOPS_DB_HOSTXOOPS_DB_USERXOOPS_DB_PASS);
}

if (!
$this->conn) {
    
$this->logger->addQuery(''$this->error(), $this->errno());
    return 
false;
}

with something that loops over different values for XOOPS_DB_USER and XOOPS_DB_PASS (you will need to use an array variable rather than constants of course).



10
-DJNZ-
Re: Is there a limitation of doing multiple "user" templates vs "admin" templates
  • 2005/4/7 18:22

  • -DJNZ-

  • Just popping in

  • Posts: 30

  • Since: 2005/1/11


I think you are misunderstanding $xoopsOption['template_main'], and making things too complicated.

The purpose of $xoopsOption['template_main'] is to set the template which is called at the appropriate time by footer.php to display the module, using template variables which have been set by your code. You do not have to do
$xoopsOption['template_main'] = 'template1.html';
do 
form stuff
$xoopsTpl
->display('db:'.$xoopsOption['template_main']);

.. just do this instead:
$xoopsOption['template_main'] = 'template1.html';
do 
form stuff
$xoopsTpl
->display('db:'.$xoopsOption['template_main']);


But to get the output of a template into a variable rather than display it, you want to use $xoopsTpl->fetch. This will give you 3 ways to incorporate the contents of different templates into your output (in fact there are more ways using output buffering but let's keep it simple for the moment).

Perhaps the simplest is to have a template (module.html) which just displays the content of one variable:

<{$moduleOutput}>


In your module, you would then do the following:
$out  $xoopsTpl->fetch('db:template1.html');
$out .= $xoopsTpl->fetch('db:template2.html');
$out .= $xoopsTpl->fetch('db:template3.html');
$xoopsTpl->assign('moduleOutput'$out);
$xoopsOption['template_main']='module.html';


... or you can use different Smarty variables, doing some work in a template like this:
<h3><{$section1}></h3>
<
table class="outer"><tr><th><{$section2}></th></tr>
<
tr><td class="odd"><{$section3}></td></tr></table>

Then your module would do something like this:
$xoopsTpl->assign('section1'fetch('db:template1.html'));
$xoopsTpl->assign('section2'fetch('db:template2.html'));
$xoopsTpl->assign('section3'fetch('db:template3.html'));
$xoopsOption['template_main']='module.html';


Or finally, you can use the power of Smarty to the full like this:
<h3><{include file='db:template1.html'}></h3>
<
table class="outer"><tr><th><{include file='db:template2.html'}></th></tr>
<
tr><td class="odd"><{include file='db:template3.html'}></td></tr></table>

... then all you need to do (apart from assign the Smarty variables used by template1.html etc.) in your module code is:
$xoopsOption['template_main']='module.html';


Good luck playing around with these!




TopTop
(1) 2 3 »



Login

Who's Online

219 user(s) are online (145 user(s) are browsing Support Forums)


Members: 0


Guests: 219


more...

Donat-O-Meter

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

Latest GitHub Commits