Drupal
How to Boost AdSense Revenue on Drupal Sites
is a context-sensitive advertising network. There are 2 kinds of ads: pay-per-view and pay-per-click. Usually, your site will show pay-per-click ads which give more revenues. However, on most drupal sites, you will see ads related to which does not actually relate to your content. This problem often occurs on index page and its sub-pages. What are the problems?
- sugree's blog
- Add new comment
- Read more
- 1374 reads
Added network name and autonomous system number
ip2cc.module for Drupal is extended database to support additional information as follows.
- Network Name
- Autonomous System Number (ASN)
In order to upgrade, you need the latest version of ip2cc.module and customized database populated by me. See demonstration.
- sugree's blog
- Add new comment
- Read more
- 1635 reads
IP to Country Demonstration
207.241.237.229
US
USA
United States
AS174 proxy-registered route by Cogent
174
- 19 comments
- 19955 reads
Patch for profile.module in Drupal 4.7.0 beta 4
Ah. There is another annoying bug in profile.module which gives wrong data in /profile. Data in fields was not cleared so the data will show in next record if fields in the next record are empty. Below is the patch for this problem.
--- profile.module.orig 2006-01-26 20:43:04.000000000 +0700
+++ profile.module 2006-01-27 20:34:54.000000000 +0700
@@ -393,6 +393,8 @@
foreach ($fields as $key => $field) {
if ($value = profile_view_field($account, $field)) {
$fields[$key]->value = $value;
+ } else {
+ $fields[$key]->value = $value;
}
}
return $fields;
- sugree's blog
- Add new comment
- Read more
- 963 reads
ping.module with extendedPing for Drupal
In recent post, I made a patch for configurable ping.module. Anyway, some ping servers don"t accept simple ping, instead they preferred extendedPing. For example, blo.gs.
diff -u ping.module ping.module
--- ping.module.orig 2005-12-31 21:18:22.000000000 +0700
+++ ping.module 2006-01-27 15:00:35.000000000 +0700
@@ -44,6 +44,32 @@
}
/**
+ * Implemetaion of hook_settings
+ */
+function ping_settings() {
+ $form["ping"] = array(
+ "#type" => "fieldset",
+ "#title" => t("Ping settings"),
+ "#collapsible" => TRUE,
+ );
+ $form["ping"]["ping_pinger_list"] = array(
+ "#type" => "textarea",
+ "#title" => t("URLs to ping"),
+ "#default_value" => variable_get("ping_pinger_list", "http://rpc.pingomatic.com"),
+ "#width" => 40,
+ "#height" => 10,
+ );
+ $form["ping"]["ping_extended_pinger_list"] = array(
+ "#type" => "textarea",
+ "#title" => t("URLs to extended ping"),
+ "#default_value" => variable_get("ping_extended_pinger_list", ""),
+ "#width" => 40,
+ "#height" => 10,
+ );
+ return $form;
+}
+
+/**
* Call hook_ping() in all modules to notify remote sites that there is
* new content at this one.
*/
@@ -58,11 +84,32 @@
*/
function ping_ping($name = "", $url = "") {
- $result = xmlrpc("http://rpc.pingomatic.com", "weblogUpdates.ping", $name, $url);
+ $pingers = explode("\n", variable_get("ping_pinger_list", "http://rpc.pingomatic.com"));
+ foreach ($pingers as $pinger) {
+ $pinger = trim($pinger);
+ if (empty($pinger)) {
+ continue;
+ }
+ $result = xmlrpc($pinger, "weblogUpdates.ping", $name, $url);
+
+ if ($result === FALSE) {
+ watchdog("directory ping", t("Failed to notify %pinger (site). %message", array("%pinger" => $pinger, "%message" => xmlrpc_error_msg())), WATCHDOG_WARNING);
+ }
+ }
- if ($result === FALSE) {
- watchdog("directory ping", t("Failed to notify pingomatic.com (site)."), WATCHDOG_WARNING);
+ $pingers = explode("\n", variable_get("ping_extended_pinger_list", ""));
+ foreach ($pingers as $pinger) {
+ $pinger = trim($pinger);
+ if (empty($pinger)) {
+ continue;
+ }
+ $result = xmlrpc($pinger, "weblogUpdates.extendedPing", $name, $url, "", "$url/rss.xml");
+
+ if ($result === FALSE) {
+ watchdog("directory ping", t("Failed to notify %pinger (site). %message", array("%pinger" => $pinger, "%message" => xmlrpc_error_msg())), WATCHDOG_WARNING);
+ }
}
}
+?>
- sugree's blog
- Add new comment
- Read more
- 1928 reads
Patch for taxonomy.module in Drupal 4.7.0 beta 4
According to patch of blogapi.module, the second problem is to save category properly. Since the taxonomy.module now support load operation in nodeapi hook, $node->taxonomy is not just a plain array of string anymore. Instead it is a standard class so taxonomy.module must handle the object correct.
--- taxonomy.module.orig 2006-01-26 15:33:20.000000000 +0700
+++ taxonomy.module 2006-01-27 20:55:11.000000000 +0700
@@ -644,6 +644,9 @@
}
}
}
+ else if (is_object($term)) {
+ db_query("INSERT INTO {term_node} (nid, tid) VALUES (%d, %d)", $nid, $term->tid);
+ }
else if ($term) {
db_query("INSERT INTO {term_node} (nid, tid) VALUES (%d, %d)", $nid, $term);
}
- sugree's blog
- Add new comment
- Read more
- 1055 reads
Recent comments
3 years 34 weeks ago
3 years 39 weeks ago
3 years 39 weeks ago
3 years 40 weeks ago
3 years 40 weeks ago
3 years 42 weeks ago
3 years 42 weeks ago
3 years 42 weeks ago
3 years 43 weeks ago
3 years 43 weeks ago