121
fatman
Re: <div> vs. <table>
  • 2004/1/29 18:13

  • fatman

  • Friend of XOOPS

  • Posts: 176

  • Since: 2003/12/13


Lots good comments so far. I would just echo the statement of use <div> when possible and make the conversion from tables to pure css.

While support across browsers can be tricky, most things can be done.

I find 'A List Apart' to be a great source of css layout tips and tricks.

Here's a good article dealing with background colour for columns.

Faux Columns at A List Apart



122
fatman
Re: kStore - product catalogue demo
  • 2004/1/28 1:52

  • fatman

  • Friend of XOOPS

  • Posts: 176

  • Since: 2003/12/13


thanks for the encouragement. I've got a new demo available.

http://noah.kerkness.ca/

login user: demo
login pass: demo

notes:
- this is a dev server and the dns doesn't work all the time. if you can't hit this url.. pm me.
- I may have debugging on :)
- you may find bugs. if you find something that could be a bug.. pm me

Things i've added:

Shopping Cart goes all the way to supplying payment information. I do plan on making the who check out optional.

LOTS of additions to the site admin!! now called no-ah admin.

Things still getting done:

Tighter validation, and cleaner deletion.
Form returns in the admin section are dynamic but i think remains buggy.
Searching in the admin section could be buggy.
Integration between store 'customer and 'xoops user' is very loose at the moment in that a XOOPS user account is not required for a customer account. Short story, duplicate logins until I have more time to look at $xoopsUser and othe r core features.

Feel free to send me private messages with any and all bugs / suggestions.

Also general comments on the admin section are also welcome. This is a concept I am working on. Currently if you have the correct permissions (root) you can actually extend the database tables and fields, even create new tables just by adding/editing system groups (tables) and system fields in the control panel. I won't go too much into that right now, but tell me if it looks interesting.


edit..
comment on ssl, we'll see. At this point it ultimately depends on how much the client in going to pay for gateway services et all



123
fatman
Re: Why are someone not using XOOPS?
  • 2004/1/27 2:17

  • fatman

  • Friend of XOOPS

  • Posts: 176

  • Since: 2003/12/13


I've tried all the cms systems you've mentioned in the last 2 months. The reason I'm using XOOPS is because how easy it is to build my own modules.

I was pretty impressed with typo3 and considered using it, but at the end of the day it felt like it would have taken me forever to figure the thing out. Even with XOOPS lack of documentation. It's a pretty simple system to customize. imho.




124
fatman
block for quickly changing debug mode
  • 2004/1/26 2:54

  • fatman

  • Friend of XOOPS

  • Posts: 176

  • Since: 2003/12/13


Hi.. I slapped this together because I while I'm working on my own modules I spend a lot of time running into the site prefrences to change the debug mode. I figured it would be handy to have a simple block which provided the option to change debug mode just like the theme's block can be used to change the current theme. The code is below for anyone interested. Should be easy to add into any module of your choice for installation.


add this to the xoops_version.php of your choice.
$modversion['blocks'][5]['file'] = "debug_mode.php";
$modversion['blocks'][5]['name'] = 'Debug Mode';
$modversion['blocks'][5]['description'] = 'pick list to change debug mode';
$modversion['blocks'][5]['show_func'] = "display_debug_options";
$modversion['blocks'][5]['template'] = 'debug_mode.html';

// Change this path depending on which module you incorporate this block into.

$modversion['blocks'][5]['options'] = '/modules/noah/blocks/change_debug_mode.php';


This is debug_mode.php the file which contains the main block function
function display_debug_options($options)
{
 
// could pull this from the database but I'm lazy
 
$debug_modes = array('0|off','1|php debug','2|smarty debug','3|blocks/sql');
    
$block['path'] = $options[0];
    
 
$i 0;
 foreach (  
$debug_modes as $k=>$v  )
 {    
  
$n explode('|'$v);
  
$block['modes'][$i]['value'] = $n[0];
  
$block['modes'][$i]['label'] = $n[1];
  
$i += 1;
 }
    
return 
$block;
}


Here is the file which accepts the post data from the block and updates your sites configs. Note: I was going to use the $xoopsConfig class for this but I'm not really sure how $xoopsConfig works yet so I just stuck with editing xoops_config table directly.

change_debug_mode.php
require('../header.php'); 

// We must always set our main template before including the header 
// I've just used a blank template here but you could
// include one that reported errors if there are any. 
$xoopsOption['template_main'] = 'blank.html'

// Include the page header 
include(XOOPS_ROOT_PATH.'/header.php');

// Assing the message for our blank module
if ( $_POST['debug_modes'] )
{
change_debug_mode($options$_POST['debug_modes']);
}

// Include the page footer 
include(XOOPS_ROOT_PATH.'/footer.php');


// The function which makes the update
function change_debug_mode($options$new_mode='')
{
 global 
$xoopsDB;

 if ( 
$new_mode != '' )
 {    
   
$sql "UPDATE xoops_config SET conf_value = ".$new_mode;
   
$sql .= " WHERE conf_name = 'debug_mode'";
   
$result $xoopsDB->query($sql);
    
   if ( 
$result )
   { 
   
redirect_header(XOOPS_URL2" debug mode updated ");
   }
 }
return;
}


And finally the block template file.
<form action="<{$xoops_url}><{$block.path}>" method="post">
<
select name="debug_modes" onChange="submit();" >
<{foreach 
item=item from=$block.modes }>
<
option value="" selected>Change debug mode</option>
<
option value="<{$item.value}>">
<{
$item.label}></option>
<{/foreach}>
</
select>
</
form>


As you can see this is hack and not really up to par with XOOPS standards, but for quick debugging it works just fine. If anyone knows how to clean this up let me know.



125
fatman
Re: XoopsMediaUploader saving file with slashes
  • 2004/1/25 3:47

  • fatman

  • Friend of XOOPS

  • Posts: 176

  • Since: 2003/12/13


I provided a work around by just renaming the file to a random number. And then called the targetFileName. here is my modified code below in case anyone is interested.

$file $_FILES[$form_field_name]['name'];
$n explode('.'$file);
$target_file $time().".".$n[1];

  
// Include the XOOPS uploader class
  
include_once XOOPS_ROOT_PATH.'/class/uploader.php';

  
// create an instance of the uploader and provide settings
  
$uploader = new XoopsMediaUploader($org_path$allowed_mimetypes$maxfilesize$maxfilewidth$maxfileheight);

  
$uploader->setTargetFileName($target_file);

  if (
$uploader->fetchMedia($form_field_name)) 
  {
    if (!
$uploader->upload()) .... continued



126
fatman
XoopsMediaUploader saving file with slashes
  • 2004/1/25 3:16

  • fatman

  • Friend of XOOPS

  • Posts: 176

  • Since: 2003/12/13


Hi I making use of a the /class/uploader.php file to assist with an image upload for a module I'm working on.

If I upload a file which has a single quote such as
image'name.jpg the file gets saved as image\'name.jpg

obviously the uploader is adding slashes for database insertion into the database. However this creates a lot of issues when trying to delete the file or change its properties via FTP or another such method. My FTP sees the file as having a prohibitted name.

Is their a reason why the file is saved with slashes? Couldn't these be added purly for storage in the database.

I'm guessing that this bit of code found in uploader.php lets me suggest a target file name. If this is correct, could someone explain to me how to engage it?
function setTargetFileName($value){
   
$this->targetFileName strval(trim($value));
}


Here is a snippet of my own code in case it helps.
// Include the XOOPS uploader class
  
include_once XOOPS_ROOT_PATH.'/class/uploader.php';

  
// create an instance of the uploader and provide settings
  
$uploader = new XoopsMediaUploader($org_path$allowed_mimetypes$maxfilesize$maxfilewidth$maxfileheight);

  if (
$uploader->fetchMedia($form_field_name)) 
  {
    if (!
$uploader->upload()) 
    {
       echo 
$uploader->getErrors();
    } else {

$uploader->getSavedDestination();
        
        
// Capture info about the file save
        
$saved_file $uploader->getSavedFileName();
        
$full_path $uploader->getSavedDestination();
        
        print 
$saved_file;
    }

  } else {
    echo 
$uploader->getErrors();
    return;
  }



127
fatman
How to upgrade your own custom module
  • 2004/1/21 19:25

  • fatman

  • Friend of XOOPS

  • Posts: 176

  • Since: 2003/12/13


Hi, I am currently working on a custom module and was hoping some of the more experienced XOOPS module developers could let me know how they handle version control.

Everytime I'm making changes to my module's database tables I end up uninstalling my module, uploading the new .sql and xoops_version.php and reinstalling it.

Could someone explain how to use phpmyadmin to create a 'upgrade' sql file that just creates new tables, changes fields ect, and how to add this into my xoops_version.php file so I can make upgrades to database structure without having to uninstall my module?

I'm very familiar with exporting structure and/or data from phpmyadmin. Should I be keeping track of all sql statements I make updating my database in a txt file somewhere? How are other's currently handling similar changes?

Your wisdom is appreciated.



128
fatman
Re: Using $_SESSION variables
  • 2004/1/21 4:42

  • fatman

  • Friend of XOOPS

  • Posts: 176

  • Since: 2003/12/13


I was having similar problems. I'm using mod_rewrite and I need to store some session variables to remember view state for some administration functions.

I was having intermitten success. Some sessions would work, some wouldn't. Some would work for a while then stop.

I never thought to add session_start(); as I had selected to use sessions and some sessions were working with no issue.

I added session_start(); and now all of them are working. I'm not sure its the right answer but it has seemed to make my sessions more reliable. :)



129
fatman
Re: Problems understanding what the PHP Debug is telling me
  • 2004/1/14 23:49

  • fatman

  • Friend of XOOPS

  • Posts: 176

  • Since: 2003/12/13


The only error you need to worry about is this one.

Error [Xoops]: Smarty: [in db:system_userinfo.html line 112]: syntax error: expecting '=' after attribute name 'ts' (Smarty_Compiler.class.php, line 1375) in file class/smarty/Smarty_Compiler.class.php line 1824

That means there is most likely a typo in your system_userinfo.html file at around 112. Smarty is expecting an '=' where there is none.

You can try to fix this bug by going to System > Prefs > Templates section, but you'll only be able to edit if you've cloned your templates and are have that cloned copy active in System > Prefs > General

All the other Notices and Warnings are not actually errors. By default PHP is configured not to show warnings/notices, XOOPS overrides this setting. So you can safely ignore these.



130
fatman
Re: kStore - product catalogue demo
  • 2004/1/14 4:55

  • fatman

  • Friend of XOOPS

  • Posts: 176

  • Since: 2003/12/13


I think you can do this easily in my catalogue. If you go to Option Groups. You can basically start creating categories of product options which can then be added to any product.

Each product in the demo should have a 'edit' icon next to it. You use this to quickly add an option group to your product. Add as many as you like.




TopTop
« 1 ... 10 11 12 (13) 14 15 16 »



Login

Who's Online

158 user(s) are online (95 user(s) are browsing Support Forums)


Members: 0


Guests: 158


more...

Donat-O-Meter

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

Latest GitHub Commits