CVS edit link for Kaka.Du

We are living in a information era. The problem for end users is not that people can not find information, but that there is just too much information out there.

In this project, I am going to build a module in drupal that can allow users to customize to which RSS, iCal feeds they want to subscribe to. After users make such personalized customization, then he/she will only see the news/calendar information from the feeds that he/she has subscribed to.

Currently in Drupal, there is a feeds.module. The difference between the proposed module and the feeds.module is that the feeds.module is an aggregation on the site level. that is the administrator decides which feeds the drupal site want to aggregate. Every one visit the drupal site will see the same aggregations.

In the proposed module, it is a feeds aggregation on individual level. there is a page which gives a list of possible interesting feeds(RSS, iCal, etc), and users can choose the ones that he/she is interested in by checking the box before the feed item. If a feed that a user is interested in is not listed, then the user can suggest that to the webmaster of the drupal site and the webmaster will add that feed to the list. The users choice is then stored in the user's profile. The users will only see the content that he/she has subscribed, which means that different users will different content based on their choice.So it is a more personalized service.

CommentFileSizeAuthor
#5 customize.zip4.58 KBKaka.Du
#1 customize.zip4.56 KBKaka.Du

Comments

Kaka.Du’s picture

Status: Postponed (maintainer needs more info) » Needs review
StatusFileSize
new4.56 KB

We are a group from Human Computer Interaction Lab at Penn State. This is part of a larger project that is going on in the lab. I am the main developer, but I am new to drupal. If there are any problems with the code, please feel free to point it out and I will correct them.

Thank you very much!

avpaderno’s picture

Issue tags: +Module review
dman’s picture

I don't see any security issues with the code - from a quick visual once-over.
Drupal code style conventions prefers the braces in a different place, so it's be cool if that was tidied up. Running the code through coder.module would be a nice start. Clean code style otherwise.

Using t() around your strings, and l() around the links (instead of "a href=...") is recommended.
You might want to put that display routine into a theme function for better formatting control.

I'm not sure I understand the purpose of the module, but I don't think there is a direct cross-over with anything already out there.

avpaderno’s picture

Status: Needs review » Needs work

I am changing the status of the report as for previous comment.

@dman: if you want the OP changes something in the code, then you should change the status to needs work. Thanks for helping in reviewing the code; any help is well appreciated, and it makes the all CVS application approval more democratic. Having a single person who reviews the code doesn't assure a plurality of point of view.

Kaka.Du’s picture

StatusFileSize
new4.58 KB

Hi dman, thank you very much for your kind comments~!
I fixed the string and url issue, I also ran through the coder. module to check the code, here is the result of the report with 6 normal warnings:

#
Line 7: global variables should start with a single underscore followed by the module and another underscore

global $rss;

#
severity: normalLine 49: global variables should start with a single underscore followed by the module and another underscore

global $rss;

#
severity: normalLine 66: Control statements should have one space between the control keyword and opening parenthesis

for($i=0; $i<$limite; $i++) {

#
severity: normalLine 66: the final ?> should be omitted from all code files
#
severity: normalLine 67: string concatenation should be formatted with a space separating the operators (dot .) and non-quote terms

$page_content.= t('< strong >'). $rs['items'][$i]['pubDate'].t(' ·').l($rs['items'][$i]['title'], $rs['items'][$i]['link'], array('attributes' => array('target' => '_blank'))).t('
');

#
severity: normalLine 71: string concatenation should be formatted with a space separating the operators (dot .) and non-quote terms

$page_content.=t('Not Be Able to Fetch the Feed');

I am totally lost about the warning on line 66 , 67 and 71..
on line 66, I do not have the ?> at all.... and for 67 and 71, I tried sevearl ways to concatenate strings, but still get the same warning....

I have also attached the new code for review.

Thank you guys very much!

avpaderno’s picture

Status: Needs work » Needs review

@Kaka.Du: Remember to change the status, when you upload new code.

Kaka.Du’s picture

@kiamlaluno , Thank you for reminding!:) You guys are so helpful!

dman’s picture

Status: Needs review » Needs work

As I understand it, 100% strict code style is not a limiting prerequisite for CVS clearance. It's just something that makes life much easier on the reviewers. What is important is that you know that the coding standards exist, and at least try to follow them when you can.
Now you've played with coder.module, I think that requirement is passed.

Anyway,

for($i=0; $i<$limite; $i++) {

Becomes:

for ($i=0; $i<$limite; $i++) {

and, oh dear..
Right... t() is used around strings of text that may need translating. It's not required around every string! t(' .') is not helpful :-)
If appropriate, leave the html outside of the t() too, although embedding a little HTML doesn't hurt.

$page_content.= t('< strong >'). $rs['items'][$i]['pubDate'].t(' ·').l($rs['items'][$i]['title'], $rs['items'][$i]['link'], array('attributes' => array('target' => '_blank'))).t('
');

.. that line was fine before, without the t(). There is nothing a translator can do with that line. Just get some spaces around the .
I just updated the guidelines on using t().

Based on the t() confusion, I'd suggest that code gets fixed as 'needs work', but as far as an application for CVS access goes, I think that's enough initiation. :-)
I wouldn't want to hold an application up for code convention whitespace issues, especially now you have started to use coder.module.

dman’s picture

ps - if you wanted to use t(), I'd probably refactor it a bit like:

$item = $rs['items'][$i];
$link = l($item['title'], $item['link'], array('attributes' => array('target' => '_blank'));
$page_content .= t('Date:<strong>@date</strong> Link: !link', array('@date' => $item['pubDate'], '!link' => $link));

Long lines are a pain, there is no harm in breaking things down into short bits with nice labels. (This is opinion-advice, not strict policy)

I only added the "Date,Link" text in there so that t() had something to do to demonstrate.
Without it,

$page_content .= "<strong>{$item['pubDate']}</strong> $link";

Would be fine too.

avpaderno’s picture

Status: Needs work » Closed (won't fix)

There have not been replies from the OP in the past 7 days. I am marking this report as won't fix.

Kaka.Du’s picture

Status: Closed (won't fix) » Needs work

I am sorry.... I will fix it.. it is just because of the final exams and the holidays... I have not got time to do that yet..
I will get back to this in about 1 week

avpaderno’s picture

Status: Needs work » Closed (won't fix)

Almost a month is passed, and no news have been heard from the OP. I am marking this report as won't fix.