//This provides default values if not supplied by the TAF or initial Salsa page var theTitle = "T'ruah: "; var theFBshare = "T’ruah: The Rabbinic Call for Human Rights is an organization of rabbis from all streams of Judaism that acts on the Jewish imperative to respect and protect the human rights of all people."; var theFBshareTitle = "T'ruah - the rabbinic call for human rights"; var theFBshareImage = "http://org2.salsalabs.com/o/5149/images/facebook_share.jpg"; //This section is needed on the regular Salsa template only function getFbshare($path){ var redirect=$path; try{ newred = redirect.split("tell_a_friend_KEY="); var tafkey = newred[1]; var taf=salsa.getObject("tell_a_friend",tafkey); if (taf != null) { if(taf.PT_facebook_share != null) theFBshare = taf.PT_facebook_share; if(taf.PT_facebook_title != null) theFBshareTitle = taf.PT_facebook_title; if(taf.PT_facebook_image != null) theFBshareImage = taf.PT_facebook_image; } } catch (err) { } } function getRedirect($dbkey){ var table = db.getObject('database_table', $dbkey); var ref = db.getObject(table.table_name, item.table_KEY); getFbshare(ref.redirect_path); if(table.table_name == 'donate_page'){ theTitle=ref.Reference_Name; return ref.Reference_Name; } else if (table.table_name == 'event') { theTitle=ref.Event_Name; return ref.Event_Name; } else { if(theFBshareTitle=="") theFBshareTitle=ref.Title; if(theFBshareImage=="") theFBshareImage="http://org2.salsalabs.com/o/5149/images/facebook_share.jpg"; print (ref.Title); } } function getTitle(){ var where = Request.getURI() ; var match = /[a-zA-Z0-9\-]+$/i.exec(where); if(match == 'signup') { match = null; } if(match != null) { var shorturl = /[a-zA-Z0-9\-]+$/i.exec(where); var orderBy = 'Last_Modified DESC'; var conditions = [ new Condition('slug', 'IN', shorturl)]; var items = db.getObjects('publish', conditions, orderBy); for each (item in items) { getRedirect(item.database_table_KEY); } } else { var lists =Request.getParameterList(); for each (list in lists) { var holdlist = list.value; var orderBy = 'Last_Modified DESC'; var conditions = [ new Condition('table_KEY', '=', list.value) ]; var items = db.getObjects('publish', conditions, orderBy,1); for each (item in items) { getRedirect(item.database_table_KEY); } } // end for each } // end match if } //end get title function // MetaTagger code by PowerThru Consulting 5/2016 jon@powerthruconsulting.com var where = Request.getURI() ; var ps = Request.getParameterList(); var a = "?"; for each (p in ps) { var n = p.name; var v = p.value; a += n+"="+v+"&"; } var u = Request.getURL(); u = u+a; if (u.endsWith("&") == true) { var n = u.lastIndexOf("&") //n = n-1; u = u.substr(0,n); } var params = Request.getParameterList(); //Our regex will look for all parameters with "_KEY" in them var key_pattern = new RegExp( "_KEY" ); //Cycle through all the parameters for(var index in params) { //If one of them matches the regex, let's use it if ( key_pattern.test( params[index]['name'] ) ) { //Grab the parameter name and value page_param = params[index]['name']; page_id = params[index]['value']; //getPageBasics(); //getPageContent(); } } function customContent($fieldName){ var conditions = [ new Condition('page_KEY', '=', page_id), new Condition('fieldname', '=', $fieldName)]; var customs =DB.getObjects('market.customfields_creation', conditions); for each (custom in customs) { return(custom.fieldcontent); } } ?>