Good "morning"
,
after few hours of sleep, I´m back and just looking on the Auden´s code ... And ... I´m a little bit surprised
...
It really works, but I´m still not sure, why is it working ... Btw. we don´t have to limit the maxlength in template, but only in code ... I´ve just tested it and it´s working in idea, that I didn´t hoped
... But it´s necessary to test it live ...
Well, who want´s to test it ... Do this ...
OPEN includes/functions_lastrss_autopost.php
FIND
Code: Select all
// prepare data for posting
$subject = $post_data['name'] . ' | ' . $post_data['items'][$i]['title'];
// cut the subject to fit the db
$subject = $db->sql_escape(substr($subject,0,100));
generate_text_for_storage($subject, $uid, $bitfield, $options, false, false, false);
replace with
Code: Select all
// prepare data for posting
$subject = truncate_string($post_data['name'] . ' | ' . $post_data['items'][$i]['title'], 255);
generate_text_for_storage($subject, $uid, $bitfield, $options, false, false, false);
OPEN includes/functions_posting.php
FIND
Code: Select all
// First of all make sure the subject and topic title are having the correct length.
// To achieve this without cutting off between special chars we convert to an array and then count the elements.
$subject = truncate_string($subject);
REPLACE-WITH
Code: Select all
// First of all make sure the subject and topic title are having the correct length.
// To achieve this without cutting off between special chars we convert to an array and then count the elements.
$subject = truncate_string($subject, 255); // $subject = truncate_string($subject);
But I´m not sure, how it works in normal running board. This function is used always when posting any message, so ... It must be checked live ... Please report, how it works and if there are no problems with board itself (posting, pm ...) and if it´s not causing any errors ...
No edits for the template is necessary - bot is posting it without templates
... But I also tested the change in template (overriding maxlength), but it doesn´t influenced the length of the topic (still 60), possibly it´s truncated differently (posting.php), but I didn´t checked it ...
Thanks Auden
@PrattP :
Are you sure, that the bot doesn´t post the topics, but they are awaiting approval ??? It can be connected to permissions ... Also, once more check, with
this package (copy the file into board root and than browse it), availibility of fopen/curl functions ...
Maybe your problem is also caused with the problem described by Auden ... Check the proposed edit please too ...
@reddevilmeuk
Hello,
Yes, if you´ll add this to your portal page - to similar part of the portal.php ...
@deanandeva
Well, upgrade to 0.1.2 and check the behavior of the text in the message. It may fix it ... Duplicity of the topics is probably fixed with the fix I´ve posted in this message (few rows higher) ...
@DiegoPino :
... w8 a few hours more ... I´ve got to go now and your problems are bigger ...