91
ralf57
Re: Need a little help from modules developers
  • 2004/2/22 23:29

  • ralf57

  • Quite a regular

  • Posts: 231

  • Since: 2003/2/3 1


thank you precious helper...
i'll follow your recommendations
and report any results to you tomorrow evening or tuesday at later.
good night.



92
ralf57
Re: Need a little help from modules developers
  • 2004/2/22 23:08

  • ralf57

  • Quite a regular

  • Posts: 231

  • Since: 2003/2/3 1


Hi mith,i've edited the file.
Now i have:
__________________

//session_start();

//include('admin/user.php');
//$connection = mysql_connect("$host","$user","$password")
//or die(mysql_error());
//mysql_select_db("$txt_db_name",$connection)
//or die(mysql_error());

include ('../../mainfile.php');

//
//Includes preferences
//
$pref = mysql_query("SELECT * FROM xoops_myleague_preferences WHERE ID = '1'")
or die(mysql_error());
$pdata = mysql_fetch_array($pref);
mysql_free_result($pref);

$team_name = $pdata['teamname'];
$d_seasonid = $pdata['defaultseasonid'];
$show_all_or_one = $pdata['defaultshow'];
$show_table = $pdata['defaulttable'];
$language = $pdata['defaultlanguage'];
$for_win = $pdata['forwin'];
$for_draw = $pdata['fordraw'];
$for_lose = $pdata['forloss'];
$print_date = $pdata['printdate'];
$top_bg = $pdata['topoftable'];
$bg1 = $pdata['bg1'];
$bg2 = $pdata['bg2'];
$inside_c = $pdata['inside'];
$border_c = $pdata['bordercolour'];
$tb_width = $pdata['tablewidth'];
$accept_ml = $pdata['acceptmultilanguage'];

//
//Query to get last updated date and time
//
//Use sitehttp://www.mysql.com/doc/en/Date_and_time_functions.html (DATE_FORMAT)
//to return date format that fits to your site
//

$updated_query = $xoopsDB->query("
SELECT DATE_FORMAT(last_updated, '%d.%m.%Y at %H:%i') AS last_updated FROM xoops_myleague_preferences WHERE ID = '1'");
$ludata = $xoops->fetchArray($updated_query);
$last_update = $ludata['last_updated'];
mysql_free_result($updated_query);

//
//If session variables are registered
//
if(!session_is_registered('defaultlanguage') || !session_is_registered('defaultseasonid') || !session_is_registered('defaultshow') || !session_is_registered('defaulttable'))
{
$_SESSION['defaultlanguage'] = $language;
$_SESSION['defaultseasonid'] = $d_seasonid;
$_SESSION['defaultshow'] = $show_all_or_one;
$_SESSION['defaulttable'] = $show_table;
$defaultlanguage = $_SESSION['defaultlanguage'];
$defaultseasonid = $_SESSION['defaultseasonid'];
$defaultshow = $_SESSION['defaultshow'];
$defaulttable = $_SESSION['defaulttable'];
}
else
{
$defaultlanguage = $_SESSION['defaultlanguage'];
$defaultseasonid = $_SESSION['defaultseasonid'];
$defaultshow = $_SESSION['defaultshow'];
$defaulttable = $_SESSION['defaulttable'];
}

//
//Gets seasons and match types for dropdowns
//

$get_seasons = $xoopsDB->query("SELECT * FROM xoops_myleague_seasonnames WHERE SeasonPublish = '1' ORDER BY SeasonName");

//
//Sort by points, sort variable is not set
//
$sort = $_REQUEST['sort'];
if(!isset($sort))
{
$sort = 'pts';
}


?>

<?php
//
//INCLUDES HEADER.PHP
//
include(XOOPS_ROOT_PATH.'/header.php');

//
//Includes languages
//
//include('language.inc');

?>
<!-- All the data print begin -->

______________________________________

Notice that i've added

"include ('../../footer.php');"

just before the end of file,was i right?



Btw i turned xoops's php debug on and it gives:
______________________
"Fatal error: Call to a member function on a non-object in c:\programmi\easyphp\www\xoops\modules\simpnews\index.php on line 75"
________________

Line 75 is:
_____________________
$ludata = $xoops->fetchArray($updated_query);
_______________________

Now remain the "includes preferences" and "session variables" matter;
what about this?

I stay tuned...




93
ralf57
Re: Need a little help from modules developers
  • 2004/2/22 22:30

  • ralf57

  • Quite a regular

  • Posts: 231

  • Since: 2003/2/3 1


Thank you,in the meantime i'm going to apply the code you edited...



94
ralf57
Re: Need a little help from modules developers
  • 2004/2/22 21:03

  • ralf57

  • Quite a regular

  • Posts: 231

  • Since: 2003/2/3 1


Thank you mith,
i've understood what you said and i'll follow your suggestions.
I have another practical thing to ask you:
Please take a look at this piece of code and give me
a short explain and (possibly) tell me how can i move on...

__________________________________
//this piece stands in almost all the pages,
//and loads the db connection data.Can i delete it?
//

session_start();

include('admin/user.php');
$connection = mysql_connect("$host","$user","$password")
or die(mysql_error());
mysql_select_db("$txt_db_name",$connection)
or die(mysql_error());

//
//Includes preferences
//
$pref = mysql_query("SELECT * FROM tplls_preferences WHERE ID = '1'",$connection)
or die(mysql_error());
$pdata = mysql_fetch_array($pref);
mysql_free_result($pref);

$team_name = $pdata['teamname'];
$d_seasonid = $pdata['defaultseasonid'];
$show_all_or_one = $pdata['defaultshow'];
$show_table = $pdata['defaulttable'];
$language = $pdata['defaultlanguage'];
$for_win = $pdata['forwin'];
$for_draw = $pdata['fordraw'];
$for_lose = $pdata['forloss'];
$print_date = $pdata['printdate'];
$top_bg = $pdata['topoftable'];
$bg1 = $pdata['bg1'];
$bg2 = $pdata['bg2'];
$inside_c = $pdata['inside'];
$border_c = $pdata['bordercolour'];
$tb_width = $pdata['tablewidth'];
$accept_ml = $pdata['acceptmultilanguage'];

//
//Query to get last updated date and time
//
//Use sitehttp://www.mysql.com/doc/en/Date_and_time_functions.html (DATE_FORMAT)
//to return date format that fits to your site
//
$updated_query = mysql_query("
SELECT DATE_FORMAT(last_updated, '%d.%m.%Y at %H:%i') AS last_updated FROM tplls_preferences WHERE ID = '1'", $connection)
or die(mysql_error());
$ludata = mysql_fetch_array($updated_query);
$last_update = $ludata['last_updated'];
mysql_free_result($updated_query);

//
//If session variables are registered
//What are these session variables?Are they necessary?

if(!session_is_registered('defaultlanguage') || !session_is_registered('defaultseasonid') || !session_is_registered('defaultshow') || !session_is_registered('defaulttable'))
{
$_SESSION['defaultlanguage'] = $language;
$_SESSION['defaultseasonid'] = $d_seasonid;
$_SESSION['defaultshow'] = $show_all_or_one;
$_SESSION['defaulttable'] = $show_table;
$defaultlanguage = $_SESSION['defaultlanguage'];
$defaultseasonid = $_SESSION['defaultseasonid'];
$defaultshow = $_SESSION['defaultshow'];
$defaulttable = $_SESSION['defaulttable'];
}
else
{
$defaultlanguage = $_SESSION['defaultlanguage'];
$defaultseasonid = $_SESSION['defaultseasonid'];
$defaultshow = $_SESSION['defaultshow'];
$defaulttable = $_SESSION['defaulttable'];
}

//
//Gets seasons and match types for dropdowns
//How can i replace this query with the XOOPS one?

$get_seasons = mysql_query("SELECT * FROM tplls_seasonnames WHERE SeasonPublish = '1' ORDER BY SeasonName",$connection)
or die(mysql_error());

//
//Sort by points, sort variable is not set
//
$sort = $_REQUEST['sort'];
if(!isset($sort))
{
$sort = 'pts';
}


?>

<?php
//
//INCLUDES HEADER.PHP
//
include('header.php');

//
//Includes languages
//
include('language.inc');

?>

<!-- All the data print begin -->

___________________________________

I hope i won't bore you...
thanks again.



95
ralf57
Need a little help from modules developers
  • 2004/2/22 18:56

  • ralf57

  • Quite a regular

  • Posts: 231

  • Since: 2003/2/3 1


Hi devs,
i'm tryin'g to port the "tplleaguestats" script into xoops.
I think that it wouldn't be difficult for an experienced coder but i'm a beginner
I faced two big problems:

1)Thew whole scipt(expecially the admin section) uses php sessions for admin authentication and this doesn't agree with XOOPS modules management.

Do i have to bypass or delete the sessions at all?
And if so,how can i do this?


2)The script retreives the MySQL connection data from a file on the server(user.php):
-----------------------
$host = 'localhost';
$user = 'root';
$password = '';
$txt_db_name = 'databasename';
----------------------

How can i change this and force the script to
retrieve the data from XOOPS database?

I know that these are annoing questions but very important for my work to go on.
Thanks in advance.



96
ralf57
Re: Modules creation docs needed
  • 2004/2/22 14:10

  • ralf57

  • Quite a regular

  • Posts: 231

  • Since: 2003/2/3 1


Quote:

tl wrote:
Wiki's module developer's guide is very good. The Kickstart Guide has everything you will need to start your module development.

Module Development Kickstart Guide




Thank you tl,i've already read the Kickstart guide but at last i think the best way to introduce myself into modules development is to study one already published.
Btw i'll be looking for further docs into various xoops-related sites over the net.



97
ralf57
Modules creation docs needed
  • 2004/2/22 0:10

  • ralf57

  • Quite a regular

  • Posts: 231

  • Since: 2003/2/3 1


Hi all,
i'm going to start my first attempt
in building a module for our wonderful cms.
I've read the wiki pages and some posts here in the forum
but i need more detailed and simple infos before start.
Is there a tutorial or anything similar,out of this i've mentioned above?
Many thanks,ralf.



98
ralf57
Re: A little question about News Wysiwyg hack by chapi
  • 2004/2/20 21:00

  • ralf57

  • Quite a regular

  • Posts: 231

  • Since: 2003/2/3 1


Thank you chapi,
you took me on the right way...
Not only your suggest worked but reading Spaw docs i discovered that there are many ways to "contruct" the editor.
In fact after a few trials now i have this:

$sw = new SPAW_Wysiwyg('hometext',$hometext,'it','mini','classic','310px','310px');

and

$sw = new SPAW_Wysiwyg('bodytext',$bodytext,'it','full','classic','650px','400px');

Exactly what i wanted to have
Thanks again,ralf.



99
ralf57
A little question about News Wysiwyg hack by chapi
  • 2004/2/19 21:33

  • ralf57

  • Quite a regular

  • Posts: 231

  • Since: 2003/2/3 1



Hi all,
i've successfully installed chapi's hack
and it works fine.
Now i'd like to have different width and height
for intro text and extended text.
I've looked into /news/admin/storyform.inc.php
but i was unable to get my goal.
Can anybody tell me the right files to edit?
Thanks in advance,ralf.



100
ralf57
Re: <{xoops_link}>....what's this variable for?
  • 2004/2/16 21:28

  • ralf57

  • Quite a regular

  • Posts: 231

  • Since: 2003/2/3 1


Quote:

Herko Coomans wrote:
It's for making relative links, so that when you move your site, you don't have to change all the links.

Herko


Thank you herko,i've understood the purpose but can you
show me a short real example?
thanks again.




TopTop
« 1 ... 7 8 9 (10) 11 12 13 »



Login

Who's Online

99 user(s) are online (56 user(s) are browsing Support Forums)


Members: 0


Guests: 99


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