var theTitle = "Action | National Physicians Alliance"; var theFBshare = "Committed to Advancing the Core Values of the Medical Profession: Service, Integrity, and Advocacy"; var theFBshareTitle = ""; var theFBshareImage = ""; var tracking_code = salsa.getParameter("code"); if(tracking_code == "") tracking_code = 'none'; //this gets some parameters from the URL function getFbshare($path){ var redirect=$path; newred = redirect.split("tell_a_friend_KEY="); var tafkey = newred[1]; var taf=salsa.getObject("tell_a_friend",tafkey); 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; } function getTitle(){ var where = Request.getURI() ; var match = /[a-zA-Z0-9\-]+$/i.exec(where); 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) { var table = db.getObject('database_table', item.database_table_KEY); var ref = db.getObject(table.table_name, item.table_KEY); getFbshare(ref.redirect_path); if(table.table_name == 'donate_page'){ theTitle=ref.Reference_Name; print(ref.Reference_Name); } else { if(theFBshareTitle=="") theFBshareTitle=ref.Title; if(theFBshareImage=="") theFBshareImage="https://salsa.democracyinaction.org/o/1021/images/fb_npa_badge.png"; print(ref.Title); } } } 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 items2 = db.getObjects('publish', conditions, orderBy,1); for each (item2 in items2) { var table = db.getObject('database_table', item2.database_table_KEY); var ref = db.getObject(table.table_name, holdlist); getFbshare(ref.redirect_path); if(table.table_name == 'donate_page'){ theTitle=ref.Reference_Name; print(ref.Reference_Name); } else { if(theFBshareTitle=="") theFBshareTitle=ref.Title; if(theFBshareImage=="") theFBshareImage="https://salsa.democracyinaction.org/o/1021/images/fb_npa_badge.png"; print(ref.Title); } } } } } //this gets some parameters from the URL var key=salsa.getParameter("tell_a_friend_KEY"); if(key == "") key = null; if (key!=null) { var taf=salsa.getObject("tell_a_friend",key); var redirect=taf.redirect_path; var tafkey=taf.tell_a_friend_KEY; } ?>