This forum is for module development and code related questions, not general module support. For general support, use the Post installation forum.

Still No Progess with Your News Aggregator?

I see not an iota of progress has been made with Drupal's news aggregator since my departure.

This module has no real utility at all. It's half-baked. It doesn't harness one tenth of the utility it could.

I shouldn't have to mod the code to do something as simple as spedifying the amount of characters I want in my feed.

I shouldn't have to spend half the day searching your site to find out there's no documentation noting the fact that Drupal doesn't do this out of the box.

It's like lending me your car without giving me the keys.

News titles on one page

Hello, comrades.

I want to output news titles on the page (without teasers and other stuff). Picture demonstrate this:

http://www.comics.com.ua/images/news.gif

I wrote such code:

<?php

function title_list($result, $title = NULL) {
  $dt = "";
  $cond = 0;
  $out = "";
  while ($node = db_fetch_object($result)) {
    $a = getdate($node->created);
    if ($cond == 0)
    {
      $y = $a['year'];
      $m = $a['mon'];
      $d = $a['mday'];
      $dt = "<p><b>".$d.".".$m.".".$y."</b></p>";
      $out = $out.$dt;
      $cond = 1;
    }
    else
      if (($y != $a['year']) || ($m != $a['mon']) || ($d != $a['mday']))
      {
        $out = $out.theme('node_list', $items, $title);
        UnSet($items);
        $a = getdate($node->created);
        $y = $a['year'];
        $m = $a['mon'];
        $d = $a['mday'];
        $dt = "<p><b>".$d.".".$m.".".$y."</b></p>";
        $out = $out.$dt;
      }
      else
        $dt = "";
    $number = module_invoke('comment', 'num_all', $node->nid);
    $items[] = l($node->title, 'node/'. $node->nid, $number ? array('title' => format_plural($number, '1 comment', '%count comments')) : '');
  }

  return $out.theme('node_list', $items, $title);
}


global $user;
if (user_access("access content"))
{
  $stories = "";
  $queryResult = db_query_range("SELECT n.uid, u.name, max(n.nid) FROM {node} n INNER JOIN {users} u ON u.uid = n.uid WHERE n.type = 'story' AND n.status = 1 GROUP BY n.uid, u.name ORDER BY 3 DESC", 0, 10);
  while ($node = db_fetch_object($queryResult))
  {
    $stories .= title_list(db_query_range("SELECT n.title, n.nid, n.created FROM {node} n WHERE n.type = 'story' AND n.status = 1 AND n.uid = " . $node->uid . " ORDER BY n.nid DESC", 0, 10));
  }
  print $stories
. "
". l(t("more"), "story", array("title" => t("Просмотреть остальные новости."))) ."
";
}
?>

It works fine, but it output titles of ALL materials from ALL vocabularies. How to modify SQL-query for outputting titles of only ONE vocabulary (f.e. "News")?

cannot redeclare function

Upon enabling a new module, I am getting this error message:

Fatal error: Cannot redeclare _hilite_get_query_terms() (previously declared in /home/choirgee/public_html/modules/hilite/hilite.module:65) in /home/choirgee/public_html/modules/hilite/hilite.module on line 65

The only place this function appears in my drupal installation is in this module (obviously) at:

line 65

Finding what user is accessing a page?

Hi everyone,

I need to query the DB for a field in the profile_values table - but im off to a very bad start :)

How do i find the users uid (or any other identifying factor) - I mean the user how is looking at the page,...

I can see a session id, and i can even see a user->uid but this does not work:

print_r($user)

So, how do i access the currnet users details?

Many thanks

attachments to comments

I badly want attachments to be added to comments can anybody help me out with that...
Regards,
A.K.Karthikeyan

Is the album/folksonomy/image suppose to work with cvs?

I'm trying to use the walkah's new image module alongside the album module. I installed folksonomy and the rest in a clean install of drupal CVS. However, I get the error

Pages

Subscribe with RSS Subscribe to RSS - Module development and code questions