11
Coplan
Re: Blocks - solved
  • 2004/5/14 3:42

  • Coplan

  • Just popping in

  • Posts: 51

  • Since: 2002/10/2


So it seems my only problem was not fully understanding how the block functions worked.

As per your recommendation, I am working on cleaning out the non-function data within my system.php file. I was trying to make my code look a little cleaner by moving the table prefixing routines to some other place. I guess it caused more problems.

But, this is my first XOOPS modules, so I think I'm doing okay.

Thank you ALL for your patience. I now know what I did wrong, and I will work to become more xoops-like in my programming. I've learned a lot from this thread. Thanks again.



12
Coplan
Re: Blocks
  • 2004/5/13 3:54

  • Coplan

  • Just popping in

  • Posts: 51

  • Since: 2002/10/2


With that line in place, I get the following error on the blank screen (and only the following error, nothing else):

Quote:

Fatal error: Call to a member function on a non-object in /opt/devel/xoops/modules/tunetracker/system.php on line 13




BTW, here is a tarball holding my entire module. It's tunetracker/blocks/tt_blocks.php that I'm having trouble with:

www.scenespot.org/coplan/tunetracker.tar.gz


You'll notice that I have the mainfile.php include commented out in system.php. I doesn't seem to make a difference if that line is present or not.

Again, I thank you all for your patience and your help. I'll probably be kicking myself when I find out the real problem.


PS -- it's all a tiny bit messy at the moment. I fully intend to do things the XOOPS way and move as much as possible into the language files. I also intend to clean up some of my subroutines.



13
Coplan
Re: Blocks
  • 2004/5/12 12:01

  • Coplan

  • Just popping in

  • Posts: 51

  • Since: 2002/10/2


I did, and didn't notice any difference.

What was supposed to happen?



14
Coplan
Re: Blocks
  • 2004/5/12 4:24

  • Coplan

  • Just popping in

  • Posts: 51

  • Since: 2002/10/2


Sorry, I was stuck for a while as my server crashed. Now that it's back in order, I set about trying to figure this out.

I hate to do this, but I'm really REALLY stumped. I'm going to post the two files as they are right now. Then I'll post the error messages I get:

First: ./modules/tunetracker/blocks/tt_blocks.php
<?php
/*****************************************************************************
        Tune Tracker Database
        Written For: SceneSpot.org
        By:  D. Travis "Coplan" North
******************************************************************************/
include_once('../../../mainfile.php');
include_once(
'../system.php');

function 
b_tunetracker_current_tunes() {
  global 
$xoopsDB$tt_sinfo$tt_users$tt_songs;

  
// I get errors if I remove these lines, as if they aren't defined.
  
$tt_users   $xoopsDB->prefix("users");
  
$tt_sinfo   $xoopsDB->prefix("tt_sinfo");
  
$tt_songs   $xoopsDB->prefix("tt_songs");

  
$block = array();

  
$sth $xoopsDB->query('SELECT *, DATE_FORMAT(s_date, "%b %d %Y") as f_date FROM '.$tt_sinfo.' ORDER BY s_date DESC LIMIT 8') or die (mysql_error());
  
  
$cnt 0;
  while (
$row $xoopsDB->fetchArray($sth)) {
    
$block['tunes'][$cnt]['url'] = XOOPS_URL.'/modules/tunetracker/viewsong.php?id='.$row[sinfo_id];
    
$block['tunes'][$cnt]['s_name'] = $row[s_name];
    
$block['tunes'][$cnt]['date'] = $row[f_date];

    
$a_sth$xoopsDB->query('SELECT uname FROM '.$tt_songs.' LEFT JOIN '
                                           
.$tt_users.' ON '.$tt_songs.'.user_id='.$tt_users
                                           
.'.uid WHERE sinfo_id="'.$row[sinfo_id]
                                           .
'" ORDER BY uname') or die (mysql_error());

    
$ac 0;
    while (
$arow $xoopsDB->fetchArray($a_sth)) {
      if (
$ac >= 1) { $block['tunes'][$cnt]['artist'] .= ', '; }
      
$block['tunes'][$cnt]['artist'] .= $arow[uname];
    
      
$ac++;
    }
  
    
$cnt++;
  }
  return 
$block;
}


?>


Next: ./modules/tunetracker/system.php

<?php
/*****************************************************************************
 *      Tune Tracker Database
 *      Written Exclusively For: SceneSpot.org
 *      By:  D. Travis "Coplan" North
 *
 *   Configuration files needed by a couple of different scripts 
******************************************************************************/

// Get module ID (used for admin checks, etc)
$mid $xoopsModule->mid();

// Beta Message -- uncomment for beta
$beta = <<<END_QUOTE
<b><em>
Please note that this is a beta release of Tune Tracker.  This is for testing
only.  Any entry added may or may not be saved for future use on the official
SceneSpot website.
</em></b>

END_QUOTE;

// Set the Tables Needed:
$tt_users   $xoopsDB->prefix("users");                                          
$tt_guests  $xoopsDB->prefix("tt_guests");                                    
$tt_sinfo   $xoopsDB->prefix("tt_sinfo");                                     
$tt_songs   $xoopsDB->prefix("tt_songs");                                     
$tt_genre   $xoopsDB->prefix("tt_genre");                                     
$tt_sgenres $xoopsDB->prefix("tt_sgenres");                                   
$tt_type    $xoopsDB->prefix("tt_type");      
$tt_files   $xoopsDB->prefix("tt_files");      
$tt_options $xoopsDB->prefix("tt_options");
$tt_votes   $xoopsDB->prefix("tt_votes");
$tt_dlcnt   $xoopsDB->prefix("tt_dlcnt");

?>


As you can see, the system.php file defines all those table names. That is the real reason why I want to call them into my blocks script. However, if I comment out the lines indicated in tt_blocks.php (3 lines, starting $tt_...), I get error messages from mySQL as if the table names weren't defined.

If I run 'php tt_blocks.php' at the command prompt, I get no errors.

Does anyone have any thoughts as to what the problem might be? I really want to get this figured out.



15
Coplan
Very simple feature requests
  • 2004/4/22 13:33

  • Coplan

  • Just popping in

  • Posts: 51

  • Since: 2002/10/2


1) When posting (or replying), there is no way to tell what forum you're in. I know that sounds like a silly request, but my users have requested it multiple times.

When you are browsing a forum, you see the tree at the top of the screen that you're browsing. I think that needs to remain at the post level.

2) On the admin side, it would be nice if there were an easy way to switch out the BB icons (locked, hot topic, etc).



16
Coplan
Re: PHPSESSID showing up in news module links
  • 2004/4/22 3:37

  • Coplan

  • Just popping in

  • Posts: 51

  • Since: 2002/10/2


So I was able to get rid of PHPSESSID, or so I thought.

There's an option in the General Preferences Admin panel called 'Use Custom Session'. If I uncheck that, it dissappears. Now I don't know what that option is really for -- I thought it allowed logins. But people can still log in. What is that option for?

So I pull up the web page now, regardless of whether or not I'm logged in, and the PHPSESSID tags are missing. But then I go to W3C's Validator, and it still sees it. I'm completely baffled by that one. I checked my source....it's not there.

So I'm even more baffled now than I was before. And Validator still spits out a bunch of erors pertaing to the PHPSESSID tag -- and only the PHPSESSID tag.



17
Coplan
Re: PHPSESSID showing up in news module links
  • 2004/4/21 12:36

  • Coplan

  • Just popping in

  • Posts: 51

  • Since: 2002/10/2


In other words, if the user doesn't allow cookies, it stores it in the URL?

But when I test the page, I'm allowing cookies. There's gotta be some other issue at hand, as if the test isn't working, or something.



18
Coplan
PHPSESSID showing up in news module links
  • 2004/4/21 2:57

  • Coplan

  • Just popping in

  • Posts: 51

  • Since: 2002/10/2


I'm getting one that might be a system bug. In the news module, there are those links at the bottom to view additional pages (1, 2, 3, etc) the PHPSESSID is showing in the links on my site. They don't show on the XOOPS site (go figure, the broken appliance always works for the repair man).

Any idea what causes that? I didn't hack any modules, especially the news engine.

Could this possibly be a PHP system option causing problems?

I'm using XOOPS 2.0.6 on a Debian (stable) linux box running PHP 4.3.3



19
Coplan
Re: Highlighting in NewBB with IE
  • 2004/4/21 1:22

  • Coplan

  • Just popping in

  • Posts: 51

  • Since: 2002/10/2


That seems to have fixed some errors.

I seem to be having other problems with the PHPSESSID...so I'm deferring this to a new topic. Once I get that settled, I'll return to figuring out if my problem is still truly a theme problem.



20
Coplan
out-bound RSS feeds
  • 2004/4/20 22:41

  • Coplan

  • Just popping in

  • Posts: 51

  • Since: 2002/10/2


I've been browsing a lot of the modules, and I see a lot of RSS modules that pull feeds from other sites. However, I havn't seen any that generate an RSS feed for your site.

I have a site (scenespot.org), and I'd like to make RSS feeds so that people can get the headlines from an RSS reader.

Anyone know of a module that does this?




TopTop
« 1 (2) 3 4 5 »



Login

Who's Online

234 user(s) are online (140 user(s) are browsing Support Forums)


Members: 0


Guests: 234


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