From 165b042d6e513ca53ab151588188a3cd4e298ea9 Mon Sep 17 00:00:00 2001 From: ozhozh Date: Sat, 22 Aug 2009 14:54:51 +0000 Subject: [PATCH] 1.3 RC1 massive commit - check for MySQL server running - More HTML template tags - Bookmarklet & Tools page - 1st attempt at filtering XSS hacks when adding new URL - Hide SQL errors - 1st code cleanup in admin/index.php to separate code and display - default bigger font - favicon - no more ### ugly comments, all // - stricter coding to prevent notices with undefined indexes - hide PHP notices, unless YOURLS_DEBUG constant set to true git-svn-id: http://yourls.googlecode.com/svn/trunk@77 12232710-3e20-11de-b438-597f59cd7555 --- admin/index.php | 225 ++++++++++++++++-------------------- admin/index_ajax.php | 10 +- admin/install.php | 10 +- admin/tools.php | 45 ++++++++ css/style.css | 71 +++++++++++- images/facebook.png | Bin 0 -> 727 bytes images/favicon.gif | Bin 0 -> 88 bytes images/friendfeed.png | Bin 0 -> 794 bytes images/twitter.png | Bin 0 -> 780 bytes includes/class-mysql.php | 2 +- includes/config-sample.php | 3 + includes/functions-auth.php | 2 +- includes/functions.php | 185 +++++++++++++++++++++++++++-- includes/version.php | 2 +- js/share.js | 41 +++++++ 15 files changed, 444 insertions(+), 152 deletions(-) create mode 100644 admin/tools.php create mode 100644 images/facebook.png create mode 100644 images/favicon.gif create mode 100644 images/friendfeed.png create mode 100644 images/twitter.png create mode 100644 js/share.js diff --git a/admin/index.php b/admin/index.php index 6edd2ad..0dedf43 100644 --- a/admin/index.php +++ b/admin/index.php @@ -1,31 +1,28 @@ =' : '<=' ); $where = " AND clicks $link_moreless $link_limit"; } else { @@ -33,7 +30,7 @@ } $base_page = YOURLS_SITE . '/admin/index.php'; -### Searching +// Searching if(!empty($search) && !empty($_GET['s_in'])) { switch($_GET['s_in']) { case 'id': @@ -56,7 +53,7 @@ $where .= " AND $search_in_sql LIKE ('$search')"; } -### Sorting +// Sorting if(!empty($_GET['s_by']) || !empty($_GET['s_order'])) { switch($_GET['s_by']) { case 'id': @@ -92,60 +89,91 @@ } } -## Get URLs Count for current filter, total links in DB & total clicks +// Get URLs Count for current filter, total links in DB & total clicks $total_items = $db->get_var("SELECT COUNT(id) FROM $table_url WHERE 1=1 $where"); $totals = $db->get_row("SELECT COUNT(id) as c, SUM(clicks) as s FROM $table_url WHERE 1=1"); -### Checking $page, $offset, $perpage -if(empty($page) || $page == 0) { $page = 1; } -if(empty($offset)) { $offset = 0; } -if(empty($perpage) || $perpage == 0) { $perpage = 50; } +// This is a bookmarklet +if ( isset( $_GET['u'] ) ) { + $is_bookmark = true; -### Determine $offset -$offset = ($page-1) * $perpage; + $url = $_GET['u']; + $keyword = ( isset( $_GET['k'] ) ? $_GET['k'] : '' ); + $return = yourls_add_new_link( $url, $keyword, $db ); + + // If fails because keyword already exist, retry with no keyword + if ( $return['status'] == 'fail' && $return['code'] == 'error:keyword' ) { + $msg = $return['message']; + $return = yourls_add_new_link( $url, '', $db ); + $return['message'] .= ' ('.$msg.')'; + } + + $s_url = stripslashes( $url ); + $where = " AND url LIKE '$s_url' "; + + $page = $total_pages = $perpage = 1; + $offset = 0; + + $text = ( isset( $_GET['s'] ) ? stripslashes( $_GET['s'] ) : '' ); + $title = ( isset( $_GET['t'] ) ? stripslashes( $_GET['t'] ) : '' ); -### Determine Max Number Of Items To Display On Page -if(($offset + $perpage) > $total_items) { - $max_on_page = $total_items; -} else { - $max_on_page = ($offset + $perpage); -} +// This is not a bookmarklet +} else { + $is_bookmark = false; + + // Checking $page, $offset, $perpage + if(empty($page) || $page == 0) { $page = 1; } + if(empty($offset)) { $offset = 0; } + if(empty($perpage) || $perpage == 0) { $perpage = 50; } + + // Determine $offset + $offset = ($page-1) * $perpage; + + // Determine Max Number Of Items To Display On Page + if(($offset + $perpage) > $total_items) { + $max_on_page = $total_items; + } else { + $max_on_page = ($offset + $perpage); + } -### Determine Number Of Items To Display On Page -if (($offset + 1) > ($total_items)) { - $display_on_page = $total_items; -} else { - $display_on_page = ($offset + 1); -} + // Determine Number Of Items To Display On Page + if (($offset + 1) > ($total_items)) { + $display_on_page = $total_items; + } else { + $display_on_page = ($offset + 1); + } + + // Determing Total Amount Of Pages + $total_pages = ceil($total_items / $perpage); -### Determing Total Amount Of Pages -$total_pages = ceil($total_items / $perpage); +} -yourls_html_head( 'index' ); +// Begin output of the page +$context = ( $is_bookmark ? 'bookmark' : 'index' ); +yourls_html_head( $context ); ?>

YOURLS: Your Own URL Shortener
YOURLS

-

Your are logged in as: . Logout

+

Your are logged in as: . Logout. Check the Tools.

-

Display to of URLs. - - Overall, tracking c); ?> links, s); ?> clicks, and counting! +

+ Display to of URLs. + + + Overall, tracking c); ?> links, s); ?> clicks, and counting!

-
-
-
- Enter the URL: - Optional: Custom short URL: - -
- -
-
+ + + ' . $return['message'] . ''; + + } ?> @@ -159,83 +187,29 @@ - - - - - - get_results("SELECT * FROM $table_url WHERE 1=1 $where ORDER BY $sort_by_sql $sort_order_sql LIMIT $offset, $perpage;"); if($url_results) { foreach( $url_results as $url_result ) { @@ -254,4 +228,9 @@ ?>
Actions
-
-
-
- -   - -
- Search for  - -  in  - - – Order by  - - - – Show  -  rows
- - Show links with - - than - clicks + $search_text, + 'search_in_sql' => $search_in_sql, + 'sort_by_sql' => $sort_by_sql, + 'sort_order_sql' => $sort_order_sql, + 'page' => $page, + 'perpage' => $perpage, + 'link_filter' => $link_filter, + 'link_limit' => $link_limit, + 'total_pages' => $total_pages, + 'base_page' => $base_page, + 'search_url' => $search_url, + ); + yourls_html_tfooter( $params ); + } + ?> - -
-
-
- Pages (): - = 4) { - echo '« First ... '; - } - if($page > 1) { - echo ' « '; - } - for($i = $page - 2 ; $i <= $page +2; $i++) { - if ($i >= 1 && $i <= $total_pages) { - if($i == $page) { - echo "[$i] "; - } else { - echo ''.$i.' '; - } - } - } - if($page < $total_pages) { - echo ' » '; - } - if (($page+2) < $total_pages) { - echo ' ... Last »'; - } - ?> -
+ + + \ No newline at end of file diff --git a/admin/index_ajax.php b/admin/index_ajax.php index dde8faf..f5fc91d 100644 --- a/admin/index_ajax.php +++ b/admin/index_ajax.php @@ -1,16 +1,16 @@ +

+ YOURLS: Your Own URL Shortener
+ YOURLS
+

+ +

Your are logged in as: . Logout

+ + +
+ +

Tools

+ +

YOURLS comes with two handy bookmarklets for easier link shortening.

+ + +

The bookmarklets will take you to a page where you can easily edit or delete your brand new short URL.

+ +

There is also a Quick Share tool box to make posting to Twitter, Facebook or Friendfeed a snap.

+ +

If you want to share a description along with the link you're shortening, simply select text on the page you're viewing before clicking on your bookmarklet link

+ +

Simple bookmarklet

+ +

Click and drag the link to your toolbar: Shorten

+ +

Advanced bookmarklet (custom keyword)

+ +

Click and drag the link to your toolbar: Custom shorten

+ +
+ + + + \ No newline at end of file diff --git a/css/style.css b/css/style.css index 2777101..c4eda16 100644 --- a/css/style.css +++ b/css/style.css @@ -1,11 +1,11 @@ body { font-family: Verdana, Arial; - font-size: 10px; + font-size: 12px; color: #595441; } div, p, td { font-family: Verdana, Arial; - font-size: 10px; + font-size: 12px; } a, a:link, a:active, a:visited { color: #4a8797; @@ -18,7 +18,7 @@ h1 {height:50px;} h1 a {float:right;text-align:right;} h1 a:hover{text-decoration:none;} h1 a:hover span{text-decoration:underline;color:#8dbdd8} -input { +input, textarea { -moz-border-radius:3px; -webkit-border-radius:3px; } @@ -51,7 +51,7 @@ input.loading { background:#cc7 url(../images/loading.gif) center center no-repeat; color:#cc7; } -input:focus { +input:focus, textarea:focus { border:2px solid #AACCAA; margin:0px; } @@ -99,6 +99,7 @@ tr:hover td.actions input{ color: green; } #footer { + margin-top:2em; text-align: center; } #login { @@ -110,4 +111,66 @@ tr:hover td.actions input{ } #login .text { width: 100%; +} +#shareboxes, #tweet { + overflow:hidden; +} +div.share { + -moz-border-radius:5px; + border:2px solid #8DBDD8; + background:#fff; + margin-right:1em; + padding:0 1em; + float:left; + height:130px; +} +#copybox { + width:250px; +} +#sharebox { + width:500px; +} +#tweet_body { + float:left; + width:450px; + height:3em; + font-size:12px; +} +#charcount { + padding-left:5px; + color:#8DBDD8; +} +#charcount.negative { + color:red; +} +#share_links a { + padding:0 12px 0 18px; + font-weight:bold +} +#share_links a:hover { + background-position:2px center; +} +#share_tw {background:transparent url(../images/twitter.png) left center no-repeat;} +#share_fb {background:transparent url(../images/facebook.png) left center no-repeat;} +#share_ff {background:transparent url(../images/friendfeed.png) left center no-repeat;} + +#tools_desc { + width:550px; + zbackground:#ffe; + padding-bottom:10px; +} +#tools_desc span { + background:#ffa; + padding:0 2px; +} + +#tools_desc .bookmarklet { + border:2px solid #2A85B3; + -moz-border-radius:3px; + padding:5px 5px 5px 20px; + background:#eef url(../images/favicon.gif) 2px center no-repeat; +} + +#tools_desc .bookmarklet:hover { + text-decoration:none; } \ No newline at end of file diff --git a/images/facebook.png b/images/facebook.png new file mode 100644 index 0000000000000000000000000000000000000000..1176590b3ee947b67fa2f7c6d7fc7b9754a69972 GIT binary patch literal 727 zcmV;|0x127P)003>6 z003>600000003>600000003>600000003>6NBc_+0007VNklsQ?dpl|oN1>3jxT?+!gU##VSVH_7R@_uM|{Mh}= zCti4PAn5Pke0}B8#ru*ZLiM-9e~D*OL8-K6es|a1(Sv7pdKfd=^6C>m>Jf1| zQS}OAbux^wK?nK|Kvq}|?OD&^y?w2{*Kfb^VW>eonc_iC7^W1~Z3n1gMOe4I2EfzT zpLy_XfWa?ynsGrU1zsM(*hIoCarwhR6pSJ8-IgzJ-jDF;`5-0VB}tXEDL6h5MFsUn zOcEaP;6Nu3S9A+-e8)MuGrdK3y-jLS87wfH4LU#rIrP z6*E0RgCR)^e$-=drgTngz6vTJ7HpxYz(h0UsC8yE%P`t6q-KYf$Yu_lgjegRCY z#-AYqVU%I*R5nhFsn%rXg@6Y>g#{x5e_<3rwB@ZTSWyZqI4FXHx41UjS-r02*qna? zRFxp`0GQWZVeP6KCEumo(a9J8lj9}hAIG+??`?E;b@xVb+}4H_VNSIZfMrX1*s*09 z9pw^%2lob|ukP^hK%-QuxIOcFH=>2HS&~WqYZZBtWm%MsjErZ4LnB!jhPl`zdj9m` zts7S_T$=eh6=2t_ISUqoZSylq1ZyqjvWxHgCJMtzn}v^o;h+1ROLuju17`pL002ov JPDHLkV1hJ+L6-mk literal 0 HcmV?d00001 diff --git a/images/favicon.gif b/images/favicon.gif new file mode 100644 index 0000000000000000000000000000000000000000..8681802c7952c92000baf308eb5cc86bd394808f GIT binary patch literal 88 zcmZ?wbhEHb6krfwn8?Jyz;Grk?9BiF|A8#UpDc_F3``6 p1&=IVhv*XBl&cngZ98k-Uv*v%DVuidBKw@V5l6n;1v4;M0{}IN9A*Fj literal 0 HcmV?d00001 diff --git a/images/friendfeed.png b/images/friendfeed.png new file mode 100644 index 0000000000000000000000000000000000000000..cede5bcb9664025e976c10ee638c7806ea225558 GIT binary patch literal 794 zcmV+#1LgdQP)003>6 z003>600000003>600000003>600000003>6NBc_+0008DNkl1|o^F@-!P6_dXo)#+@#< zj$B<%ySk29vX!T*BR(dMPNsbS@ENV5pf_0I^rEDWn!#|D=|Xt?DQWuS!Z`(BynvWC_|_P;{oR*GaKmlJFKmBIGfDKvW)%xQ;d*#T6ev z*d#BS%&o&T6}5oDgYyAV8AgLK8c>KNlu{_I5lJ+f8QpG++67XANI*m|0gLkyArdnP zL1;8Gbf!rup%j>gMntHpK(nPu34}=fUj-k8NF)=;jOOU*6_fKDT5ZGm`3-w}$A~0? zM3PS=fute;MkG^8CFOiX1!3#G0h7rbQex}@5fU_-2~tqz;Md*D zkG4O#YIlbtTUy$AlegX;0FY9mKPdj!VLA1NX&|BIpX0-mY;t;XW7@eM4A(zEJh8TQ zaMlH9U0iZ-*2UU738jm!^b+ji@y`#x{`QN{K3B_&6~K1U8;(KJ?Qhhovh#U#X8-^I07*qoM6N<$g695gMgRZ+ literal 0 HcmV?d00001 diff --git a/images/twitter.png b/images/twitter.png new file mode 100644 index 0000000000000000000000000000000000000000..ccb1b618963c52a441bd2b059fae90346ffd97ab GIT binary patch literal 780 zcmV+n1M~ceP)003>6 z003>600000003>600000003>600000003>6NBc_+0007~NklK zv}00jLXys8a_`K%|DMOiO@&ZA@GPGnhr>Ar;O550*(>KSd{Pv}t1%@W$#7B%$CN*WbEy>5hHv`t|0@(z#EU`U}@4RRy_4RBM1Sk3j$$?e^uS%9n3{_4S%P_w=*R zjZPD6r5dXk;1t&XZIhgH*vY*KRN7uDoVPM+coM%uF*g#FSX>cDUG`XDWuJ z){NVG504>+%+#&`#5oQ}!+D!h(sJgBj%o|R*$TJ=jUOeG2;7wb}`0~t5C&&4H1TulCDuy z6%`>090ho169gp*ywHOiD_tc0%_Js>0be_aOr0ZV zzpRKNU@ajAEPxLYVTPz6qByCa-dr}EX&y%}f%oogGO8-_EF%{o#z+K0W&Km9R#g-Y&S~(T7`#dG#Ays( zybt1hb??X9pRa%X;Rla)(gD_ret$8q_w>I?IVMadCEkAr?EDKQX`=G4-NZKl0000< KMNUMnLSTZKHeIX$ literal 0 HcmV?d00001 diff --git a/includes/class-mysql.php b/includes/class-mysql.php index cbceba9..2837791 100644 --- a/includes/class-mysql.php +++ b/includes/class-mysql.php @@ -32,7 +32,7 @@ class ezSQLcore{ var $debug_all = false; // same as $trace var $debug_called = false; var $vardump_called = false; - var $show_errors = true; + var $show_errors = false; var $num_queries = 0; var $last_query = null; var $last_error = null; diff --git a/includes/config-sample.php b/includes/config-sample.php index 3b7ae26..cd2c5bb 100644 --- a/includes/config-sample.php +++ b/includes/config-sample.php @@ -25,6 +25,9 @@ ** Site options */ +/** Turn this on to enable error reporting. Recommended value is false **/ +define('YOURLS_DEBUG', false); + /** Short domain URL, no trailing slash */ define('YOURLS_SITE', 'http://site.com'); // diff --git a/includes/functions-auth.php b/includes/functions-auth.php index 2908819..b614f4c 100644 --- a/includes/functions-auth.php +++ b/includes/functions-auth.php @@ -3,7 +3,7 @@ function yourls_is_valid_user() { // Logout request - if($_GET['mode'] == 'logout') { + if( isset( $_GET['mode'] ) && $_GET['mode'] == 'logout') { setcookie('yourls_username', null, time() - 3600); setcookie('yourls_password', null, time() - 3600); return 'Logged out successfully'; diff --git a/includes/functions.php b/includes/functions.php index 47795f0..ae4f6d9 100644 --- a/includes/functions.php +++ b/includes/functions.php @@ -3,7 +3,13 @@ * YOURLS * Function library */ - + +if (defined('YOURLS_DEBUG') && YOURLS_DEBUG == true) { + error_reporting(E_ALL); +} else { + error_reporting(E_ERROR | E_WARNING | E_PARSE | E_USER_ERROR | E_USER_WARNING); +} + // function to convert an integer (1337) to a string (3jk). Input integer processed as a string to beat PHP's int max value function yourls_int2string( $id ) { $str = yourls_base2base(trim(strval($id)), 10, YOURLS_URL_CONVERT); @@ -20,7 +26,7 @@ function yourls_string2int( $str ) { } // Make sure a link id (site.com/1fv) is valid. -function yourls_sanitize_string ($in) { +function yourls_sanitize_string($in) { if (YOURLS_URL_CONVERT <= 37) $in = strtolower($in); return substr(preg_replace('/[^a-zA-Z0-9]/', '', $in), 0, 12); @@ -35,7 +41,7 @@ function yourls_sanitize_url($url) { if ( !preg_match('|[^:]+://|', $url ) ) $url = 'http://'.$url; - return $url; + return htmlspecialchars($url); } // Make sure an id link is a valid integer (PHP's intval() limits to too small numbers) @@ -103,7 +109,7 @@ function yourls_table_edit_row($id, $db) { // Add a link row function yourls_table_add_row( $id, $keyword, $url, $ip, $clicks, $timestamp ) { - $date = date( 'M d, Y H:i', $timestamp+( yourls_HOURS_OFFSET * 3600) ); + $date = date( 'M d, Y H:i', $timestamp+( YOURLS_HOURS_OFFSET * 3600) ); $clicks = number_format($clicks); $www = YOURLS_SITE; @@ -144,6 +150,7 @@ function yourls_insert_link_in_db($url, $id, $db) { function yourls_add_new_link($url, $keyword = '', $db) { if ( !$url || $url == 'http://' || $url == 'https://' ) { $return['status'] = 'fail'; + $return['code'] = 'error:nourl'; $return['message'] = 'Missing URL input'; return $return; } @@ -160,10 +167,11 @@ function yourls_add_new_link($url, $keyword = '', $db) { // Custom keyword provided if ($keyword) { - $keyword = yourls_sanitize_string($keyword); + $keyword = mysql_real_escape_string(yourls_sanitize_string($keyword)); if (!yourls_keyword_is_free($keyword, $db)) { // This id either reserved or taken already $return['status'] = 'fail'; + $return['code'] = 'error:keyword'; $return['message'] = 'URL id '.$keyword.' already exists in database or is reserved'; } else { // all clear, store ! @@ -171,7 +179,7 @@ function yourls_add_new_link($url, $keyword = '', $db) { yourls_insert_link_in_db($url, $id, $db); $return['url'] = array('id' => $id, 'keyword' => $keyword, 'url' => $strip_url, 'date' => date('Y-m-d H:i:s'), 'ip' => yourls_get_IP() ); $return['status'] = 'success'; - $return['message'] = $strip_url.' (ID: '.$keyword.') added to database'; + $return['message'] = $strip_url.' added to database'; $return['html'] = yourls_table_add_row( $id, $keyword, $url, yourls_get_IP(), 0, time() ); $return['shorturl'] = YOURLS_SITE .'/'. $keyword; } @@ -193,7 +201,7 @@ function yourls_add_new_link($url, $keyword = '', $db) { $keyword = yourls_int2string($id); $return['url'] = array('id' => $id, 'keyword' => $keyword, 'url' => $strip_url, 'date' => $timestamp, 'ip' => $ip); $return['status'] = 'success'; - $return['message'] = $strip_url.' (ID: '.$id.') added to database'; + $return['message'] = $strip_url.' added to database'; $return['html'] = yourls_table_add_row( $id, $keyword, $url, $ip, 0, time() ); $return['shorturl'] = YOURLS_SITE .'/'. $keyword; } @@ -204,6 +212,7 @@ function yourls_add_new_link($url, $keyword = '', $db) { } else { // URL was already stored $return['status'] = 'fail'; + $return['code'] = 'error:url'; $return['message'] = $strip_url.' already exists in database'; $return['shorturl'] = YOURLS_SITE .'/'. yourls_int2string( $url_exists->id ); } @@ -296,7 +305,11 @@ function yourls_db_connect() { or !class_exists('ezSQL_mysql') ) die ('DB config/class missing'); - return new ezSQL_mysql(YOURLS_DB_USER, YOURLS_DB_PASS, YOURLS_DB_NAME, YOURLS_DB_HOST); + $db = new ezSQL_mysql(YOURLS_DB_USER, YOURLS_DB_PASS, YOURLS_DB_NAME, YOURLS_DB_HOST); + if ( $db->last_error ) + die( $db->last_error ); + + return $db; } // Return JSON output. Compatible with PHP prior to 5.2 @@ -382,7 +395,14 @@ function yourls_api_output( $mode, $return ) { function yourls_html_head( $context = 'index' ) { // Load components as needed switch ( $context ) { + case 'bookmark': + $share = true; + $insert = true; + $tablesorter = true; + break; + case 'index': + $share = false; $insert = true; $tablesorter = true; break; @@ -390,6 +410,8 @@ function yourls_html_head( $context = 'index' ) { case 'install': case 'login': case 'new': + case 'tools': + $share = false; $insert = false; $tablesorter = false; break; @@ -399,10 +421,11 @@ function yourls_html_head( $context = 'index' ) { - Insert URL « YOURLS » Your Own URL Shortener | <?php echo YOURLS_SITE; ?> + YOURLS » Your Own URL Shortener | <?php echo YOURLS_SITE; ?> + - + @@ -413,6 +436,9 @@ function yourls_html_head( $context = 'index' ) { + + + - + +
+
+
+ Enter the URL: + Optional: Custom short URL: + +
+ +
+
+ + + + +
+
+
+ +   + +
+ + Search for  + +  in  + + – Order by  + + + – Show  +  rows
+ + Show links with + + than + clicks + + +
+
+ + + Pages (): + = 4) { + echo '« First ... '; + } + if($page > 1) { + echo ' « '; + } + for($i = $page - 2 ; $i <= $page +2; $i++) { + if ($i >= 1 && $i <= $total_pages) { + if($i == $page) { + echo "[$i] "; + } else { + echo ''.$i.' '; + } + } + } + if($page < $total_pages) { + echo ' » '; + } + if (($page+2) < $total_pages) { + echo ' ... Last »'; + } + ?> + + + + + +
+ + + + +
+ + + + \ No newline at end of file diff --git a/js/share.js b/js/share.js new file mode 100644 index 0000000..c6fac9f --- /dev/null +++ b/js/share.js @@ -0,0 +1,41 @@ +$(document).ready(function(){ + $('#tweet_body').focus(); + + $('#tweet_body').keyup(function(event){ + var text = escape( $('#tweet_body').val() ); + var tw = 'http://twitter.com/home?status='+text; + var ff = 'http://friendfeed.com/share/bookmarklet/frame#title='+encodeURI( $('#tweet_body').val() ) ; + $('#share_tw').attr('href', tw); + $('#share_ff').attr('href', ff); + + var charcount = parseInt(140 - $('#tweet_body').val().length); + $('#charcount') + .toggleClass("negative", charcount < 0) + .text( charcount ); + }); + + $('#copylink').click(function(){ + $(this).select(); + }); + +}) + +function share(dest) { + var url = $('#share_'+dest).attr('href'); + switch (dest) { + case 'ff': + //$('body').append(''); + window.open(url, 'ff','toolbar=no,width=500,height=350'); + break; + case 'fb': + //var url = $('#share_fb').attr('href'); + window.open( url, 'fb','toolbar=no,width=1000,height=550'); + break; + case 'tw': + //var url = $('#share_tw').attr('href'); + window.open(url, 'tw','toolbar=no,width=800,height=550'); + break; + } + return false; +} + -- 2.45.0