Enige tijd alweer geleden dat ik op het forum was, druk en eigenlijk werkte de site. Tot vandaag ik een artikel wilde toevoegen en zag dat er vanuit de UDT geen mail werd verstuurd. In de log gekeken en zie daar:
Ik heb gelezen dat de nuSOAP overbodig is geworden, dus daarom in de Module folder deze nuSOAP-folder hernoemd, maar dat biedt geen oplossing.Cannot load module ModuleManager ... Problem loading dependent module nuSOAP version 1.0.1
Ik draai versie 1.11.10. Iemand een idee wat hier aan de hand kan zijn?
Verder wordt er dus geen mail verstuurd. De code die hiervoor verantwoordelijk is, is:
Code: Select all
/*******************************************************
* about
*******************************************************/
/*
This UDT can be used to automatically post a Twitter message when a news article is added.
The functionality is based on the Twitter and News module.
- First you need to install and setup the News and Twitter module.
- After you need to create a UDT with this code, for example you can call it: 'news_twitter_update_status'
- At last you need to connect this UDT to the 'NewsArticleAdded' event.
This can be done via Extensions -> Event Manager.
[s]! Currently this UDT only works when pretty urls are enabled.
It seems that the bit.ly url shortner ($twitter->shortenUrls($link)) has some problems with unfriendly urls.
Querystring parameters &var=1 are converted to &=1 which will break the link.[/s]
==
update: 16 Dec 2011
==
- This UDT is now compatible with cmsms 1.10
- Works with and without pretty urls bit.ly problem seems solved
- Added the ability to shortenurl's
- Added support for the news_url field, if you use these it's best to turnshortenurl's off
==
UPDATE: 4 Jan 2011
==
- Added the $extra_param configuration option
- Added the $hashtags configuration option
config:
- specify: $detailpage (page_id) of the news detail view.
- specify: $shortenurl (true|false) will use the bit.ly url shortner or not.
- specify: $extra_param (string) to add a default hashtag.
- specify: $hashtags (array) to modify the $params['title'] into a title with #hashtags, if $hashtags = array(); no replacement will take place
: for example: $hashtags = array('cup', 'foo', 'bar');
: "We have won the cup I repeat worldcup, well that is not my cupoftea" -> "We have won the #cup I repeat #worldcup that is not my #cupoftea"
*/
/*******************************************************
* globals/objects
*******************************************************/
$modops = cmsms()->GetModuleOperations();
// echo ' modops = ' . $modops;
$twitter = $modops->get_module_instance('Twitter');
// echo ' twitter = ' . $twitter;
$cgblog = $modops->get_module_instance('CGBlog');
// echo ' cgblog = ' . $cgblog;
/*******************************************************
* config
*******************************************************/
/* debug (bool) */
$debug = false;
/* custom (string) */
$detailpage = '';
/* shortenurl (bool) */
$shortenurl = true;
/* Prefix to use on all URLS from the blog module (string) */
$cgblog_page = $cgblog->GetPreference('urlprefix','cgblog');
/* Extra parameter to add with tweet, f.i. a #xyz */
$extra_param = '#uisgebeatha';
/* $hashtags (array) */
$hashtags = array('zeilen', 'wedstrijd', 'watersport');
/*******************************************************
* variables
*******************************************************/
/* CGBlog article related (string) */
$cgblog_id = $params['cgblog_id'];
// echo 'cgblog_id = ' . $cgblog_id;
$title = $params['title'];
// echo ' title = ' . $title;
/* added to link (array) */
$link['articleid'] = $params['cgblog_id'];
/*******************************************************
* subroutines
*******************************************************/
/**
* fetch the $cgblog_url by $cgblog_id
*
* @param string $cgblog_id
* @return string $cgblog_url
*
*/
function fetch_cgblog_url($cgblog_id){
$db = cmsms()->GetDb();
$query = "SELECT url
FROM ". cms_db_prefix(). "module_cgblog
WHERE cgblog_id = ?";
$cgblog_url = $db->GetOne($query, array($cgblog_id));
return $cgblog_url;
}
/*******************************************************
* program
*******************************************************/
$aliased_title = munge_string_to_url($title);
// echo ' aliased_title = ' . $aliased_title;
// echo ' cgblog_url = ' . $cgblog_url;
// echo ' cgblog_id = ' . $cgblog_id;
$cgblog_url = fetch_cgblog_url($cgblog_id);
// echo ' cgblog_url = ' . $cgblog_url;
//$cgblog_tags = fetch_cgblog_extra_field($cgblog_id);
//echo '$cgblog_tags = ' . $cgblog_tags;
if ($cgblog_url != '') {
$prettyurl = $cgblog_url;
} else {
// if $detailpage == '' we don't want an extra /
if ($detailpage != '') {
$prettyurl = $cgblog_page . '/' . $cgblog_id . '/' . $detailpage . "/$aliased_title";
} else {
$prettyurl = $cgblog_page . '/' . $cgblog_id."/$aliased_title";
}
}
echo ' prettyurl = ' . $prettyurl;
$link = $cgblog->CreateLink($cgblog_id, 'detail', $detailpage, '', $link,'', true, false, '', true, $prettyurl);
$gCms = cmsms(); //global $gCms;
$editedby = $gCms->variables['username'];
$bodytext = 'Hallo,<br /><br>Er is op ' . date('l j F Y', $params['start_time']) . ' een nieuw bericht op www.uisge-beatha.eu geplaatst.<br><br><hr>
<h2> ' . $params['title'] . '</h2>
' . $params['summary'] . '
<br clear="right"><br>Lees het volledige artikel op ' . $link . '<br><hr>Wil je deze berichten niet meer te ontvangen? Stuur deze e-mail terug met met vermelding van je emailadres en uitschrijven.';
$cmsmailer =& cms_utils::get_module('CMSMailer');
$cmsmailer->SetFrom('no-reply@uisge-beatha.eu');
$cmsmailer->SetFromName('www.uisge-beatha.eu');
$cmsmailer->AddAddress('gjdgraaf@gmail.com', $name='gjdgraaf@gmail.com');
$cmsmailer->SetBody($bodytext);
$cmsmailer->IsHTML(true);
$cmsmailer->SetSubject('Nieuw bericht op www.uisge-beatha.eu');
$cmsmailer->Send();
Code: Select all
$gCms = cmsms(); //global $gCms;
$editedby = $gCms->variables['username'];
Verder zie ik in de Admin Log nogal wat foutmeldingen:
Kortom, er is het e.e.a. aan de hand waarvan mij de oorzaak niet duidelijk is. Enige hulp zou erg welkom zijn!Error: Syntax error in template "module_db_tpl:CGB has occured 06/11/14 05:19:43
Error: Syntax error in template "39b2fcd68918298c1 has occured 06/11/14 04:49:55
Core Cannot load module ModuleManager ... Problem loading dependent module nuSOAP version 1.0.1 06/10/14 22:10:46
Error: Syntax error in template "f797bdf4a3e08f52e has occured 06/10/14 21:22:17
Core Cannot load module ModuleManager ... Problem loading dependent module nuSOAP version 1.0.1 06/10/14 21:10:08
Automated Task Succeeded ClearCacheTask 06/10/14 21:09:25
Automated Task Succeeded PruneAdminlogTask 06/10/14 21:09:25
Error: Syntax error in template "module_db_tpl:CGB has occured 06/10/14 19:53:48
Error: Unable to load template module_db_tpl 'Gall has occured 06/10/14 19:53:42
Error: Syntax error in template "module_db_tpl:CGB has occured 06/10/14 19:53:28
Error: Syntax error in template "8fdd4261ec4a0128b has occured 06/10/14 09:20:08
Error: Syntax error in template "8fdd4261ec4a0128b has occured 06/10/14 09:20:05
Error: Syntax error in template "f797bdf4a3e08f52e has occured 06/10/14 09:20:02
Error: Syntax error in template "module_db_tpl:CGB has occured 06/10/14 08:43:35
Alvast dank,
Gregor