21
JCDunnart
Re: Why does Xoops use .html, when it should be .tpl?
  • 2007/4/20 11:55

  • JCDunnart

  • Not too shy to talk

  • Posts: 114

  • Since: 2006/7/1 5


I think you need to read the Smarty manual.

Smarty uses compiled templates, which are native PHP. The template extension is irrelevant. And the obvious reason which I can think of for using .html is so designers can use normal html editors to design templates. Using the .html extension tells the editor which syntax to use for code highlighting.



22
JCDunnart
Re: PHP5 and documents downloading instead of opening....
  • 2007/4/18 15:33

  • JCDunnart

  • Not too shy to talk

  • Posts: 114

  • Since: 2006/7/1 5


If you had to add "AddType application/x-httpd-php .php" to the configuration file then it looks like your host did not install PHP 5 correctly.

Good luck...



23
JCDunnart
Re: PHP5 and documents downloading instead of opening....
  • 2007/4/18 4:26

  • JCDunnart

  • Not too shy to talk

  • Posts: 114

  • Since: 2006/7/1 5


You restarted the service after making the change to httpd.conf and it still didn't work?



24
JCDunnart
Re: Codeblock width
  • 2007/4/16 8:47

  • JCDunnart

  • Not too shy to talk

  • Posts: 114

  • Since: 2006/7/1 5


style.css,
find the 'xoopsCode' style and add a width value.

At xoops.org I think they use:
div.xoopsCode {    font-size12px;
    
font-familyFixedSys"Courier New",Courier,monospace;
    
background#fffff8;
    
border1px solid #6C87B0;
    
color#385a72;
    
width95%;
    
height200px;
    
margin0.5em;
    
overflowauto;
    
padding3px 3px 3px 3px;
}


Tip - I found this by using the firefox Web Developer extension



25
JCDunnart
Re: xoopsDB & Error number: 0
  • 2007/4/16 8:30

  • JCDunnart

  • Not too shy to talk

  • Posts: 114

  • Since: 2006/7/1 5


$xoopsDB->query( $sql ) will only execute:
1. when the sql statement is a 'select' statement or
2. when the insert/update/delete statement is coming from a $_POST request.

This is for security, so that $_GET requests are only able to 'view' data, not perform updates on the database.

To make your code work you need to either call the script using a POST request, or force the update by using $xoopsDB->queryF( $sql ). It's your choice which to use.

If you want to convert a GET request to POST you can use the confirmation page. This page is submitted as a POST request, which then allows the sql statement to be executed.

e.g.
if ( isset( $_POST['ok'] ) ) {
    
// execute your sql 
} else {
    
xoops_confirm( array( 'ok' => ), 'index.php'CONFIRM_TEXT );
}


If you don't want user interaction then use queryF.



26
JCDunnart
Re: Stop FOREACH looping using BREAK (PHP)
  • 2007/4/9 10:14

  • JCDunnart

  • Not too shy to talk

  • Posts: 114

  • Since: 2006/7/1 5


Well, I don't understand it - both the 'index' and 'iteration' syntax should have given the same result.

Very weird... but you got it to work, that's the main thing



27
JCDunnart
Re: Stop FOREACH looping using BREAK (PHP)
  • 2007/4/8 11:17

  • JCDunnart

  • Not too shy to talk

  • Posts: 114

  • Since: 2006/7/1 5


Post the code you're using.

This Smarty structure works, so it must be something out of place in your code...



28
JCDunnart
Re: Stop FOREACH looping using BREAK (PHP)
  • 2007/4/8 9:10

  • JCDunnart

  • Not too shy to talk

  • Posts: 114

  • Since: 2006/7/1 5


Possible solution:
<table>
<
tr>
    <
td>
    <{foreach 
item=blog_user from=$block.popnupblog name=foo}>
        <{if 
$smarty.foreach.foo.index == 5}>
            </
td><td>
        <{/if}>
        ... [
content]
    <{/foreach}>
    </
td>
</
tr>
</
table>

Keep in mind that arrays are zero-based - the first item is 0, the next is 1 etc...



29
JCDunnart
Re: Stop FOREACH looping using BREAK (PHP)
  • 2007/4/7 21:35

  • JCDunnart

  • Not too shy to talk

  • Posts: 114

  • Since: 2006/7/1 5


Assign a name value then use the Smarty 'first' or 'last' construction.

e.g. Pseudo code
<{foreach item=blog_user from=$block.popnupblog [color=FF0000]name=foo[/color]}>
    <{if 
$smarty.foreach.foo.last}>
    ...
    <{else}>
    ...
    <{/if}>
<{/foreach}>


More details in the manual.



30
JCDunnart
Re: Xoop works fine in debug mode but crash in NO debug mode
  • 2007/3/30 4:31

  • JCDunnart

  • Not too shy to talk

  • Posts: 114

  • Since: 2006/7/1 5


Do you have gzip compression on?




TopTop
« 1 2 (3) 4 5 6 ... 10 »



Login

Who's Online

73 user(s) are online (38 user(s) are browsing Support Forums)


Members: 0


Guests: 73


more...

Donat-O-Meter

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

Latest GitHub Commits