Archive for the ‘from my own programming notebook’ Category
Is it possible to code in default field mapping in page feeds_register_step2.php?
In admin/feeds_register_step2.php, you will find this function which generates the drop-down boxes for each of the field mappings:
function field($title,$name,$prefixHTML="")
{
global $productRecordFields;
print "<tr>";
print "<td><nobr>".$title."</nobr></td>";
print "<td>".$prefixHTML;
$default = (isset($_POST[$name]) ? $_POST[$name] : “”);
widget_selectArray($name,$productRecordFields,$default,”Select..”);
widget_errorGet($name);
print “</td>”;
print “</tr>”;
}Simply replace the entire function with this version:
function field($title,$name,$prefixHTML="")
{
global $productRecordFields;
print "<tr>";
print "<td><nobr>".$title."</nobr></td>";
print "<td>".$prefixHTML;
$default = (isset($_POST[$name]) ? $_POST[$name] : “”);
if (!$default)
{
$defaults["fieldName"] = array(”PRODUCTNAME”,”NAME”,”PRODUCT_NAME”,”productTitle”);
$defaults["fieldDescription"] = array(”DESCRIPTION”,”shortdescription”);
$defaults["fieldImageURL"] = array(”IMAGEURL”,”IMAGE_URL”,”imageurl”);
$defaults["fieldBuyURL"] = array(”DEEPLINK”,”PRODUCTURL”,”deeplink”);
$defaults["fieldPrice"] = array(”PRICE”,”Price”);
if (is_array($defaults[$name]))
{
foreach($defaults[$name] as $test)
{
if ($productRecordFields[$test])
{
$default = $test;
break;
}
}
}
}
widget_selectArray($name,$productRecordFields,$default,”Select..”);
widget_errorGet($name);
print “</td>”;
print “</tr>”;
}In this version you will see an array of default values for each of the different fields, used from left-to-right, the first one found in the record will be used as the mapped field name. Simply edit these lists as appropriate for your own feeds. The above work great with the UK networks Affiliate Window / Tradedoubler / Webgains…
Robot Control Code Generation Tool
Robot Control Code Generation Tool
http://www.mcanerin.com/EN/search-engine/robots-txt.asp
Open multiple windows at one click
Open multiple windows at one click
<html>
<head>
<script type=“text/javascript”>
function open_win() {
window.open(“http://www.java2s.com/”)
window.open(“http://www.java2s.com/”)
}
</script>
</head>
<body>
<form>
<input type=button value=“Open Windows” onclick=“open_win()”>
</form>
</body>
</html>
How do I allow a / character in description?
it’s line 165 of includes/admin.php:
$record[$admin_importFeed["field_description"]] = tapestry_normalise($record[$admin_importFeed["field_description"]],”,’\'\.%!”);…REPLACE this with:
$record[$admin_importFeed["field_description"]] = tapestry_normalise($record[$admin_importFeed["field_description"]],”,’\'\.%!\/”);(in other words, just add / to the list of allowed characters, but it must be preceded by the escape “\” character)
The latest thing from Google are Knols
You can write basic units of knowledge for including into Google just by going to the Knol mini-site
This might be good for search engines and seems to have advantages over wikipedia