Page 1 of 1
Popfetcher / put in category based on email subject
Posted: Fri May 11, 2007 1:02 pm
by flupirupi
Am I really that stupid?
In this discussion
http://board.s9y.org/viewtopic.php?t=3649 the feature that I want (category inseration based on the text inside the [] in the email subject) is discussed and added.
I use the current version of popfetcher (v1.17) and it just does not work as it should.
I see the text inside the [] removed but the inseration in a category fails. I don't get any error messages or something..
Is there some way I have to "activate" this feature?
By the way: The other feature discussed (the xxx-blog-xxx marker works perfectly)
Maybe I'm just blind and stupid after this endless week at work..
Re: Popfetcher / put in category based on email subject
Posted: Fri May 11, 2007 2:41 pm
by garvinhicking
Hi!
What are your category names? What are you putting into [...] brackets?
It might be a special character issue. Only use latin ISO-8859-1 characters for category names, other characters in email subjects cannot be properly supported easily.
Best regards,
Garvin
Re: Popfetcher / put in category based on email subject
Posted: Fri May 11, 2007 2:56 pm
by flupirupi
Hi!
I have totally regular names..one is called "random" (without the ") and the other one "volunteership". I also tested it with multiple email clients / webmail interfaces, the same result.
The strange thing is, that it's obviously working for other people.
/Rupert
Re: Popfetcher / put in category based on email subject
Posted: Fri May 11, 2007 3:02 pm
by garvinhicking
Hi!
What's your blog url, so I could check out the category names there?
Did you check upper vs. lowercasing? Which serendipity version are you using?
It seems the category look up fails. Write a simple 'Test.php' file into your root:
Code: Select all
include 'serendipity_config.inc.php';
$cat = serendipity_fetchCategoryInfo(null, 'random');
print_r($cat);
This should get you some debug info about the 'random' category name. If it does not output anything, this means the serendipity_fetchCategory() function call can't really get your category info.
If it DOES output anything, it seems as if the email subject line might add some extra spacing or whitespace to the string?
Regards,
Garvin
Re: Popfetcher / put in category based on email subject
Posted: Fri May 11, 2007 3:58 pm
by flupirupi
Hi!
You can find the blog I'm working on at:
http://www.bagofsweets.tk
The problem is that this blog is for the organisation I work for, so I can not test your code snippet, since the ServerAdmin is not here today. I guess we have to continue this on monday...too bad..
/Rupert
Posted: Mon May 14, 2007 1:23 pm
by flupirupi
Hi again!
I put up this testcode now and it doesn't give me any output.
I think I did everything right - just to make sure, here is the whole html file I uploaded (since I'm not into developing for the web):
Code: Select all
<html>
<body>
<?php
include 'serendipity_config.inc.php';
$cat = serendipity_fetchCategoryInfo(null, 'random');
print_r($cat);
?>
</body>
</html>
I'm using the latest version of s9y (1.1.2)
I checked upper and lowercase - no difference.
/Rupert
Posted: Mon May 14, 2007 3:51 pm
by garvinhicking
Hi!
Under which URL did you upload this? If possible I'd love to see the factual output.
If possible, could you please modify that file test.php to this:
Code: Select all
<html>
<body>
<?php
include 'serendipity_config.inc.php';
function my_fetchCategoryInfo($categoryid, $categoryname = '') {
global $serendipity;
if (!empty($categoryname)) {
$query = "SELECT
c.authorid,
c.categoryid,
c.category_name,
c.category_description,
c.category_icon,
c.parentid,
c.hide_sub
FROM {$serendipity['dbPrefix']}category AS c
WHERE category_name = '" . serendipity_db_escape_string($categoryname) .
echo $query . "<br />\n";
$ret =& serendipity_db_query($query);
print_r($ret);
return $ret[0];
} else {
$query = "SELECT
c.authorid,
c.categoryid,
c.category_name,
c.category_description,
c.category_icon,
c.parentid,
c.hide_sub
FROM {$serendipity['dbPrefix']}category AS c
WHERE categoryid = " . (int)$categoryid;
echo $query . "<br />\n";
$ret =& serendipity_db_query($query);
print_r($ret);
return $ret[0];
}
}
$cat = my_fetchCategoryInfo(null, 'random');
print_r($cat);
?>
</body>
</html>
Best regards,
Garvin
Posted: Mon May 14, 2007 4:17 pm
by flupirupi
Hi!
I modified the test.html file and uploaded it.
You find it at this address:
http://beckasin.natverketsip.se/blogs/s ... /test.html
I see a lot of stranges letters (with all kinds of apostrophes and stuff..
/Rupert
Posted: Mon May 14, 2007 4:19 pm
by garvinhicking
Hi!
You must upload this file as "test.phP" - NOT with .html ending! else the file cannot be parsed with PHP.
The strange characters are strange, indeed. You seem to have made a problem with copy+paste. Or you saved the file in some strange encoding instead of ISO-8859-1 or UTF-8?
Regards,
Garvin
Posted: Mon May 14, 2007 4:27 pm
by flupirupi
Sh*t, I really don't know anything about the whole php/web development stuff...maybe I should really take a look into it..
I uploaded the test.php file to
http://beckasin.natverketsip.se/blogs/s ... y/test.php
I get a parse error, unexpected T_STRING in line 4...
/Rupert
Posted: Mon May 14, 2007 4:30 pm
by garvinhicking
Hi!
Hhhm, what is in line 4? Maybe it's still not pasted properly and some special characters occur?!
Regards,
Garvin
Posted: Mon May 14, 2007 5:07 pm
by flupirupi
Hi!
I took your code, pasted it into the Textwrangler (a Texteditor for Mac OS X) and saved it in UTF-8 with Unicode linebreaks. Here is the file that I created from your instructions.
I sent the file to your email address.
/Rupert