(and confirm USAction/TrueMajority membership)
var theTitle = "Join USAction"; var theFBshare = "Join hundreds of thousands of USAction members from across the country in the fight to put America back to work, and make the economy and the government work for working families again."; var theFBshareTitle = "Join USAction"; var theFBshareImage = "https://secure.truemajority.org/o/2/images/june7_usaction.jpg"; 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(ref.Title=="") ref.Title=theFBshareTitle; if(theFBshareImage=="") theFBshareImage="https://secure.truemajority.org/o/2/images/fb_badge_usaction.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(ref.Title=="") ref.Title=theFBshareTitle; if(theFBshareImage=="") theFBshareImage="https://secure.truemajority.org/o/2/images/TM_logo_verticle.gif"; print(theFBshareTitle); } } } } } ?>