|
|

楼主 |
发表于 2013-1-17 17:37:25
|
显示全部楼层
////////////////////////////////////////////////////////////////////////////////* ~8 s' m+ \& s1 N k5 }! h1 m
// Theme Option k t8 n0 K( ]/ W0 i7 v
////////////////////////////////////////////////////////////////////////////////
7 Q7 Q3 A# L3 z. n6 P( X, w
4 `' h5 t/ V2 c9 G" e( P$themename = "Zenx";
- @ N3 P8 ^4 K" l7 x$shortname = str_replace(' ', '_', strtolower($themename));- I% h; z5 i, _* B, j! J. Y/ |
, Z" W; k$ o( S8 L8 c0 Lfunction get_theme_option($option)
; D- E" |& W+ f5 H; C; o# N/ z{
2 H: V$ J, g+ L5 Z global $shortname;# e; J9 o/ p' g! l" z' P9 |; w
return stripslashes(get_option($shortname . '_' . $option));
# G1 \; O' n8 ?' f ?}
/ o# o0 s: \* X/ Q) U2 H, \5 ^5 Q% y+ T. c8 K
function get_theme_settings($option)3 Y3 \7 D' s1 m- i; A
{' f! T% w6 u8 R# u
return stripslashes(get_option($option));- U1 X) ~7 T8 G3 z
}
0 E* C( l9 ?' Q$wp_dropdown_rd_admin = $wpdb->get_results("SELECT $wpdb->term_taxonomy.term_id,name,description,count FROM $wpdb->term_taxonomy LEFT JOIN $wpdb->terms ON $wpdb->term_taxonomy.term_id = $wpdb->terms.term_id WHERE parent > -1 AND taxonomy = 'category' AND count != '0' GROUP BY $wpdb->terms.name ORDER by $wpdb->terms.name ASC");
0 X1 Z1 l8 `, N( Q$wp_getcat = array();
% ` `# D- u* uforeach ($wp_dropdown_rd_admin as $category_list) {
3 L3 C }1 ]0 O) f9 R$wp_getcat[$category_list->term_id] = $category_list->name;
7 F3 L/ L! O+ ]0 L& W}
- n8 R" X' A6 V `) `1 J& e! E$category_bulk_list = array_unshift($wp_getcat, "Choose a category:");
3 ]7 `2 L0 q B( V2 x$number_entries = array("Number of post:","1","2","3","4","5","6","7","8","9","10");/ h$ F) q& M9 Y, n- Y
$crop_position = array("Choose Crop Position","middle","middleleft","middleright","topcenter","topleft","topright","bottomcenter","bottomleft","bottomright");
0 Y! P$ h% F2 W& w0 G
, v, [( N, a8 u7 N9 h$options = array (
3 v C8 f- n9 n R- s3 W$ k* }( X }2 A9 Q: v% W
4 E l: K% z# G0 p( O0 [* |
array( "name" => "Blog Header Settings",3 k, k6 |( k$ R% [% M; b( I
"type" => "heading",
. e z: C3 E' J0 A$ B& J6 K, ?4 b ),
. b4 I& b4 r* r& [/ a0 _% {' [* y/ M
array( "name" => "Use Custom Logo On The Blog Header?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
Z9 ~3 j% S$ g) k. {' H' ?; v "id" => $shortname."_header_logo_activate",) |5 l+ ?0 q5 T5 @ X" e# K& |
"type" => "select",% H" R3 u- E% J3 t
"std" => "No",2 D4 J9 }% c% B( V3 q
"options" => array("No", "Yes")),
( i- Z; N z4 I: f2 h6 R- y% K, ^' y( a& O
array( "name" => "Insert The Full URL Location Of Your Logo Here <br /><em>*leave blank if not use</em>",
0 ^5 p) ~4 u) H- b- M0 z, g: k "id" => $shortname."_logo_url",
1 r7 F1 ], @0 B! ? "type" => "text",
9 b5 O% ~( [ L1 S: `1 L "box" => "social",8 C/ ^; |/ ?7 o. O( D' i Y2 c$ V& U
"std" => "",+ T7 N1 v1 }! i" B* C
),; K$ T( b6 F+ Y/ O
: k; n; [3 z4 n7 ]" `6 @ array( "name" => "Insert Header Banner HTML Code (Header)
6 N3 e4 e/ {8 O <br /><em>*Recommended Size 468 x 60</em>/ w# M& Z N) ~- Y+ K+ W" t
<br /><em>*leave blank if not use</em>",
5 r! y5 E3 ^; z+ ~1 R "id" => $shortname."_header_banner",5 z& d& ^' J0 }5 a0 U& V; }
"type" => "textarea",+ h( l5 ?5 @2 `8 x' W' W$ _
"std" => ""," A0 I6 a8 e& e
),& K6 J& C% l4 |
2 x/ h0 v$ E; `" k- |& C, T% b8 {+ w
array( "name" => "</div></div>",
! U; q. T5 q& ?8 @1 X "type" => "close",
" I2 F [8 K( x9 i5 W ),' Z! X! {9 F7 e) D9 i- g3 t2 k* A
9 l" d0 E/ q% n
- E8 b- o7 F) g( L array( "name" => "Header Navigation Settings",! @3 ]# {: c% `
"type" => "heading",$ F2 W! v4 b8 u9 }1 X9 Y3 i
),
; ?& Z+ @5 m/ s1 i' C5 D1 r+ p: a q
array( "name" => "Insert Page ID To Exclude On Header Navigation<br />9 l# \4 U$ r6 z' T0 x/ u
<em>i.e ../wp-admin/page.php?action=edit&post=<span class=\"redbold\">123</span></em><br />$ \; F7 u5 a2 Q5 }; q
<em>*Enter the page post ID number only</em><br />
+ N; Z! b$ z( @! o1 D <em>*separate by comma</em><br />
# X% `! _) {) n5 C8 W+ f <em>*Exclude pages which you don't want to show on the header navigation</em>",
( t( A |1 t, e# v9 N1 \ B8 n "id" => $shortname."_header_page_navigation",
& I& w J# R* a% H, K, d# p "type" => "text",5 L9 h0 C0 X* m/ \) N: \
"std" => "",8 C$ a( [; D. N- w+ @/ Q- |; W, x& j. c
),
( L! G7 l( I/ X, S1 D5 r; a. F' Y5 k, L8 Z
array( "name" => "</div></div>",) s/ H4 [0 Q! Z7 O' B
"type" => "close",
; A- v1 P) R' K# s' I7 i d) F& K ),8 [6 A8 h3 h8 S$ G5 B. r0 `" k
b& K1 k+ K y. L+ z: z
2 s0 x) j; ?" Y3 R6 a' C# d7 k, i array( "name" => "Post Auto Thumbnails Settings",
4 g. C* H7 J2 f( `7 U "type" => "heading",
; E; p) y+ e, b0 v, o8 C ),
. s: k2 u I- @ _
/ ?$ Y# c/ b; B( Q% Q3 Q9 C array( "name" => "Use <strong>Timthumb Script</strong> For Auto Thumbnails?<br /><em>*Disable by default, Choose Yes to enable it.</em>",% v4 h' ~4 q& \! G0 z4 G
"id" => $shortname."_timthumb_activate",2 e. L" F5 a* y6 p9 T8 ?! h) w
"type" => "select",# Q0 e& g, ?# Y7 A# G, v$ ~
"std" => "No",
$ g" s* F) D& N" I, w3 o "options" => array("No", "Yes")),
+ e7 o# ]: j% W$ O7 P4 T6 A# N 4 ?) f% @9 @! w2 t; U) C: |
array( "name" => "If Timthumb is enabled, Please choose its cropping method",9 D9 G2 V. P) F5 h! s4 t; l
"id" => $shortname."_timthumb_cropping",
' u6 c7 v& m+ e4 s9 m3 { "type" => "select",6 [( D! D7 B2 E: ?
"std" => "",
* V6 k; C7 y$ Z! ` "options" => $crop_position),
8 R5 r: Z" U- V6 A9 W! H5 d( {( |0 K6 d- m7 ?& y
array( "name" => "Insert Width Of Thumbnail Image<br />5 Z# p4 }, q3 N( \5 e& ^- W
<em>i.e. <span class=\"redbold\">88, 100, 150, etc</span></em><br />
- R5 d9 L+ Z. O7 N5 L <em>*Leave Blank To Use Default: 250</em><br />",
0 C& x" U, G& c/ R "id" => $shortname."_thumb_width",
: u2 O e" m p "type" => "text",
4 R$ v! J+ e& ]: C2 E7 A ] "std" => "",
* S0 `- l( j' A2 n' { ),
5 d) m# y! C: a- M' ?' R" }9 ?5 H/ a! Z; h/ [$ u
array( "name" => "Insert Height Of Thumbnail Image<br />$ `; d% F' F# e5 u, V
<em>i.e. <span class=\"redbold\">88, 100, 150, etc</span></em><br />
6 C4 ^8 t6 E2 z {0 } <em>*Leave Blank To Use Default: 200</em><br />",
$ |1 ^5 h7 G2 v/ P "id" => $shortname."_thumb_height",+ B2 h6 v8 h+ S6 s. }7 w# X% l
"type" => "text",
6 y% |; c8 P( v$ @3 W( x "std" => "",
5 l& D8 S" p$ W4 L! C6 C3 h# @ ),
1 G0 m. @6 P' @; q$ k, E
1 p$ G: F1 C+ T+ a, H2 h1 n array( "name" => "</div></div>",! B' s& Y& @ L7 n
"type" => "close",
. e9 ?8 O t* o, o/ ] ),
% G( @& b. p* K( i" ]
2 c4 J! e1 n/ h ?/ S array( "name" => "Featured Content Slider Settings",% }7 G3 K' h* Y+ H
"type" => "heading",
' t$ d$ T2 ^) k8 j; e( T ),; f4 c1 _5 Y5 @ q
+ v4 X$ b7 i8 W1 q. | r! Q8 ~# V array( "name" => "Enable <strong>Featured Content Slider</strong> On Homepage?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
, [1 z& {+ W7 K1 v "id" => $shortname."_featured_activate",
6 O9 D* X# W9 @ "type" => "select",+ }" S/ _6 U$ R# A. a: ~
"std" => "No",* |# O& S3 s" M1 O& e# B9 @
"options" => array("No", "Yes")),
& `0 F, n1 C' T# u% @; h: y# N" k! y7 ` z( ?' J0 L# G7 C2 V, U
/ `: g1 B1 t5 m4 m
array( "name" => "Choose Which <strong>Category</strong> To Put On The Featured Slider?",
9 I n8 Z) v/ g; v& T- L) Y u "id" => $shortname."_featured_category",
6 o7 B. B2 m9 L" I "type" => "select",! D8 |! L" |) M4 s! g: V$ M; |
"std" => "Choose a category:",# Q1 e9 x: w0 B2 r, v$ E, O( ^( q
"options" => $wp_getcat),
# p- r6 U% E( {& H
4 E+ l& L5 o. K! L3 S$ L array( "name" => "Choose How Many <strong>Post</strong> To Show On The Featured Slider?",0 ? ~ \6 E" K8 u6 ~, u) g; x
"id" => $shortname."_featured_number",6 n9 m. e) r# E/ ~2 V% M
"type" => "select",
+ `; B; D0 P5 \' w' _! r$ Z! b$ ? "std" => "Number of post:",1 l3 _9 s0 C( U$ K( h
"options" => $number_entries),
: }" b! c" h" C/ G4 g9 a
, _5 u' b) w7 C# |' Q array( "name" => "</div></div>",
( C n0 N J5 j5 v: `/ Z "type" => "close",
+ H! [0 r' v' z, u+ ~8 Q/ Y ),
( s# D1 c# k2 H( M
8 v' p }! c( |, C$ L5 g9 m array( "name" => "Featured Category Settings",: H3 ]) I; r$ y6 z" N% g4 H1 T
"type" => "heading",/ r) |2 J1 C4 t8 r
),
* \; d% r! {$ s& f8 y1 u' O5 `/ A
2 O5 K, h: r }2 w, _6 D array( "name" => "Enable <strong>Featured Category Showcase On Sidebar</strong>?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
5 C0 x' z2 l: X5 Z7 Z "id" => $shortname."_featured_category_activate",* x6 s# ^1 C9 M: ^
"type" => "select",
, D! m4 {9 k9 f% Q+ h5 X* q "std" => "No",
; \$ m% l G" Y. j1 l "options" => array("No", "Yes")),3 f- N6 j) ]/ U, A
4 s# F, Y. g6 K/ L7 O
array( "name" => "Choose Category To Feature On 1st Block?<br /><em>*Leave it as default if not use.</em>",7 ?# R) V1 K, |9 a# G* [& o+ _' q, q
"id" => $shortname."_featured_category_id1"," I, P, M9 }1 z
"type" => "select",
0 i& `/ T4 i9 U# g& {3 i "std" => "Choose a category:",4 {/ x! Z* e# r+ h+ U+ R% o- F2 Y8 u1 x
"options" => $wp_getcat),; Q/ s4 c- Y: y! U" M4 h! Z4 k
7 z5 B4 M8 h* Q# J" m, D+ a2 N
array( "name" => "Choose How Many <strong>Post</strong> To Display On 1st Block?<br /><em>*Leave it as default if not use.</em>",
& m) O7 g% z/ `. Z+ O/ j "id" => $shortname."_featured_number1",
1 m) G( P6 j/ l7 M "type" => "select",
1 W& i5 g$ ^0 A7 L" y6 H) y "std" => "Number of post:",
" n. l( k4 W) ] "options" => $number_entries),
& d4 ?4 e7 O- ~; x P2 f; ~ ! T/ U+ V8 D. O$ q8 j+ p0 t
array( "name" => "Choose Category To Feature On 2nd Block?<br /><em>*Leave it as default if not use.</em>",9 b* b) P) f1 N
"id" => $shortname."_featured_category_id2",2 g1 }0 Q* u. ^8 j4 \: Z
"type" => "select",
" f8 f. u( u1 c" [6 s- x "std" => "Choose a category:",
2 w$ o( R. Q( N& y/ Z2 P z& z4 N "options" => $wp_getcat),- o" u) ^, O* U8 W% D* I4 H2 \
% V1 a5 }+ N& a* T, h# a array( "name" => "Choose How Many <strong>Post</strong> To Display On 2nd Block?<br /><em>*Leave it as default if not use.</em>",! a/ t8 \* v) n! ^( g; ~- ?+ j
"id" => $shortname."_featured_number2",
& M; l. W6 c7 t, t "type" => "select",
$ Q( k' [' Z7 u, I& e5 o D "std" => "Number of post:",
6 d4 u/ G# v1 d# L& Y; Z- [ "options" => $number_entries),
4 M# @7 q3 I! a% g * m( n3 I' Y9 A, w I
- R/ g( n: n. N8 m1 u# n
array( "name" => "Choose Category To Feature On 3rd Block?<br /><em>*Leave it as default if not use.</em>",
$ D8 d" ?: d5 X* g2 K* B "id" => $shortname."_featured_category_id3",+ u: h1 Z# J+ t& r& R
"type" => "select",+ H" l5 k F( u6 i2 w# D" q
"std" => "Choose a category:",8 R( i! b9 X3 K
"options" => $wp_getcat),5 \6 O' k* ]2 K# A$ }
: @' P+ a3 Y% V4 A. s9 V/ f' K# l array( "name" => "Choose How Many <strong>Post</strong> To Display On 3rd Block?<br /><em>*Leave it as default if not use.</em>",
, }( L. m( R4 l1 l4 c "id" => $shortname."_featured_number3",
) M5 z8 P6 D5 ]6 [* D6 w7 ? "type" => "select"," e; K& M/ D* t1 `/ ~; q4 ]# u
"std" => "Number of post:",. B- ^9 w& `! j
"options" => $number_entries),0 j. X9 F" g1 Y( f- p! K- r) Z
8 v4 W& b. S7 ?; M+ u
, b5 B8 g/ `8 v2 k# S+ K/ j
array( "name" => "</div></div>",
/ ^# Z" V3 z' ?9 S( q "type" => "close",
$ G8 K8 Q, u9 _" i0 n0 n+ b% \# S ),
d1 H/ r$ F, T7 f/ }( J; B& J! j0 E* t; r* y
- E$ K: E& c6 B8 f4 o array( "name" => "Google Adsense & Analytics Settings",' ~) b( m0 A j# Z7 l2 A+ ^
"type" => "heading",6 z4 R: l" g8 Y( {1 v( c1 c2 H
),
% m" ]4 Z1 i) B. f2 o+ w+ }
! f) Y6 ` |" d2 @5 B7 G array( "name" => "Enable Google Adsense Loops Within Posts<br /><em>*default are disable, you can activate it by choosing enable</em>",) u# u* r6 S( D$ e. X
"id" => $shortname."_adsense_loop_activate",0 i& l7 A; ?7 g) Z
"type" => "select",
+ j: a4 g; U0 Z& X& X% A "std" => "Disable",
' T1 {- h$ L$ l* Q+ l "options" => array("Disable", "Enable")),+ Z+ ^8 {, E, q2 d( J
' n5 n3 I% e* \
array( "name" => "Insert Google Adsense Code For Loops Here<br />: E. x- U1 K" m% n! _( \
<em>*Copy & Paste Your Google Code Or Affiliate Network Banner Code Here</em>",
; G% K& z# f' ]2 @ "id" => $shortname."_adsense_loop",
9 Z9 P7 L; k! ~" H' R: k "type" => "textarea",
' R8 g* e0 M# A5 E2 ^ "std" => "",
1 m8 K: P, _8 [9 q# y/ w/ Y, S ),
( m: T$ l3 v* I( X' p1 Q& f9 |
2 ~% b5 M5 U" H+ u array( "name" => "Enable Google Adsense On Single Page<br /><em>*default are disable, you can activate it by choosing enable</em>",
m9 a1 ]; h/ g, Z "id" => $shortname."_adsense_single_activate",( u! u- {& b! m6 {
"type" => "select",
9 Z$ T2 R6 ~; G0 W( l x( J5 p "std" => "Disable",
4 A9 e+ L- y7 I, `$ c1 G5 M "options" => array("Disable", "Enable"))," F' A/ M1 p$ G" E' c& c7 ]
" y7 C$ t) m, p2 U array( "name" => "Insert Google Adsense Code For Single Page Here<br />. o. @ e4 a9 l( A) e6 S3 v
<em>*Copy & Paste Your Google Code Or Affiliate Network Banner Code Here</em>",6 b: J8 o/ l" |- T7 H \7 Y
"id" => $shortname."_adsense_single",$ S. Q4 i* ]0 I4 V4 v
"type" => "textarea",
0 W+ O0 r( P0 H& o "std" => "",
+ k3 N+ c: V. J ),
5 _/ }3 d" j* X1 S% x- e/ u' A0 t6 [' Z
! e$ a) F o) x9 e+ Z array( "name" => "Insert Google Analytics code <br /><em>*optional - leave it blank if not using</em>",
9 l) ]. j$ R. T% N; y+ g& {; y "id" => $shortname."_google_analytics",
1 q: Y% x Z" k$ Q "type" => "textarea",
4 U0 o# D# Z, G9 v "std" => "",
7 B3 n) W* Y% L/ v) c# q+ R ),
! i% P0 X* g. ~( O5 y) n8 Q( L/ K, D8 B! D' b' `0 I/ A
array( "name" => "</div></div>",
: S1 E1 s2 V+ m1 A8 U "type" => "close",
" o: [! u9 n- G" `2 H& Q ),
0 I7 I% e9 L& C) L w% R" m
) t6 d# Z& j3 q: R+ }: [. v0 L " K$ E/ U$ @0 f! j$ F1 k- b& d
array( "name" => "AddThis Social Bookmarking Settings",2 V! U O$ L2 v o$ e! b
"type" => "heading",
+ e6 ^* [. \6 b2 ~3 d2 f1 I! H" F ),- P7 P5 C4 _7 J1 b9 [
" S; I, Y) U8 V1 \* V# @3 `' S array( "name" => "Insert you AddThis ID here (Only For Tracking Purpose) <br /><em>*leave blank if not necessary</em>6 ~% k9 x( _& C5 D7 g3 D" e
<br /><em>*Get a Free AddThis ID <a href=\"http://www.addthis.com\" target=\"_blank\">here</a> if you don't have one</em>",) c. }, I) Y. V/ v- E
"id" => $shortname."_addthis",
' K$ y' p3 i; U6 p "type" => "text",3 A6 {5 G9 @0 Q& s" H
"box" => "social",
" j' W1 U6 s4 m0 o8 \2 ]+ d "std" => "",6 I3 E$ x f* r% D
),
$ N8 q( a9 n* _/ {: T6 x/ V$ r& e/ }: k2 ~
array( "name" => "</div></div>",3 C, n/ d, D7 U$ @' e
"type" => "close",1 r" r" o- d& s& k$ \
),
7 {0 p3 \4 \4 T% F& } 5 O2 x( w6 d1 z! K Z2 f7 x) ^
* M4 b+ E R ~ b. J# D% H
+ R- E' e; d t array( "name" => "YouTube Video Settings",( o9 M# n3 f; [3 v- l) }& R% M
"type" => "heading",
( r, R2 M5 \! R& R) e6 I: h3 u3 I ),
( R1 `9 V1 S7 s6 r# b% o5 \4 r! P& ]9 D7 v& l% e, K
array( "name" => "Enable <strong>YouTube Video</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
7 q) K* S/ _+ z7 z3 I7 D1 M. D% N "id" => $shortname."_emvideo_activate",
, c/ s' i) D* ]0 c, [ "type" => "select"," v1 o# x* x( v& F; F1 q9 \
"std" => "No",: L+ P& T5 u& F7 ?
"options" => array("No", "Yes")),
2 I T8 ~8 i# u+ G
; T$ N0 @' j1 @1 j) I/ g; i array( "name" => "Insert YouTube Video Unique Code<br /><em>*You can find videos to embed on <a href=\"http://www.youtube.com\" target=\"_blank\">YouTube</a> site.</em><br /><em>i.e. Youtube - http://www.youtube.com/watch?v=<span class=\"redbold\">Hr0Wv5DJhuk</span></em><br /><em>*Only Insert The Red Bolded Code Inside Below Setting Box.</em>",
$ d) M F) @, i, f8 e "id" => $shortname."_emvideo",
# t1 C8 w M2 Q; H8 d/ i "std" => "",- }. W [" s c5 q3 n/ d
"type" => "text"),
1 A) I0 Y4 p' N. I5 b( U+ u0 O' v
1 R$ w/ T- I7 a array( "name" => "</div></div>",: x8 Z5 D" F' n9 m: K
"type" => "close",
( t5 Z8 P3 {# P7 S d% q& W" _ ),# a# X& ~8 F0 T5 \5 Z& [
" _; `, r( _7 ~ s0 W
array( "name" => "Twitter Settings",& Z/ c3 m5 b% u% P; N7 P5 R2 A
"type" => "heading",: S6 g9 A$ K' |% Q9 ^9 E2 I
),
! ^3 {2 W: p5 U1 e" {, D1 _% c! h9 s8 N" k' e" s% T
array( "name" => "Enable <strong>Twitter</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",, Y# e$ |5 Y: Z5 [
"id" => $shortname."_twitter_activate",
, W5 J# u: S. F2 K# r "type" => "select",
# q# q7 ^2 L6 A1 B "std" => "No",! V9 u" {/ @7 K
"options" => array("No", "Yes")),
4 ?& A0 o3 z4 _0 D4 V' I4 W. L7 C' Y& X* Z% i
array( "name" => "Insert Your Twitter ID here6 k0 r% t1 }* T1 l
<br /><em>*leave blank if not necessary</em>
; |- S0 @' |) v; e! b <br /><em>*Register Twitter for free <a href=\"http://www.twitter.com\" target=\"_blank\">here</a> if you don't have one</em>",
% F# p+ n- K6 D% ^* `4 d7 \ "id" => $shortname."_twitter",8 @1 K. H( F' t* [ A: t1 p
"type" => "text", {+ k) d6 w2 V
"box" => "social",
7 ]3 r, A5 f+ _; R: w( S8 P7 e "std" => "",
" P3 C' d w5 x; Q ),
& C( m( Y1 }) F2 F' @6 w' ]; f# w* ^% w/ @$ I- j
array( "name" => "Enter Twitter Feed Count here
2 ^: `0 Q3 D+ D4 F% p% K3 p <br /><em>*leave blank if not necessary</em># `4 k9 D2 x" h
<br /><em>*Enter How Many Twitter Feed To Display</em>",
& U X8 W; Z* j/ y& \* I "id" => $shortname."_twitter_count",
x: t7 a4 a0 k; f e$ W "type" => "text",
) l# i% D& v5 J "box" => "social",
6 a7 {" x X5 Q "std" => "",& g" R: _' y$ _) y* c' x% N
),2 f- }* u. B6 U1 S" {) t3 n
8 w/ N) O! C q G
array( "name" => "</div></div>",6 F$ h+ P# Q: ^
"type" => "close",
( [2 L$ M* n5 L6 `' T; z )," t; `/ N; u! n) z* V9 Q( A
5 D2 Z% W h; G( H: z4 r
1 b3 L" @ n/ d/ W" u" o% S
array( "name" => "125 x 125 Banners Advertisement Settings",% H: R. Y y$ T) @3 l( F
"type" => "heading",
! u2 i0 W1 M% r5 n/ c8 h ),
8 U2 Y1 d ] {3 F8 D8 S$ C 3 j* o5 D& ~, ?1 r
array( "name" => "Enable <strong>125 x 125 Banners</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",2 P9 y( Z0 W [3 E
"id" => $shortname."_sponsor_activate",
; E% C6 i; S0 F3 T1 Y. `, G& d "type" => "select",/ { c2 @ C. @" g* w8 E
"std" => "No",
$ g/ L; a2 ]$ g% r2 Q! p "options" => array("No", "Yes")),
& B+ r! X0 h* s! z# g3 m% p
2 T. I- x! w: X( O& q) H- h. i8 ?% q% F m5 i
array( "name" => "Insert Sponsor Banner One HTML Code<br /><em>*leave blank if not use</em>",
1 R6 D0 I8 t1 p/ l- @. ?' m "id" => $shortname."_sponsor_banner_one",% R0 ^! T6 _( e2 k A
"type" => "textarea",7 ^) O9 c; u0 {; `# @
"std" => "",
" }6 T0 N$ F9 ^! b" V$ H ), + k X2 e0 h% m6 v
3 {- t a, d: m( n+ g
array( "name" => "Insert Sponsor Banner Two HTML Code<br /><em>*leave blank if not use</em>",- u4 Y; \/ J$ ]! m( e; T- K
"id" => $shortname."_sponsor_banner_two",
+ d9 A2 U& ^5 n "type" => "textarea",! n2 d% Y3 m2 S1 {
"std" => "",
8 i2 s. {9 @# [* [ ),
7 L1 x% h, h8 u8 x7 {
/ `! [) F- U' l0 `) P. k+ E- F array( "name" => "Insert Sponsor Banner Three HTML Code<br /><em>*leave blank if not use</em>",
I+ z$ u0 j% Z u+ L* ~0 p- M "id" => $shortname."_sponsor_banner_three",7 W" g/ j' y; J2 m
"type" => "textarea",
% e5 d! N" ]7 B* o) t5 o5 X% ] "std" => "",
* p8 \! R2 h3 m1 q5 G4 | ),8 h4 R' \8 L& K0 b6 z1 E7 m
. E/ N7 r6 ~# L1 D6 U array( "name" => "Insert Sponsor Banner Four HTML Code<br /><em>*leave blank if not use</em>"," o3 E) y( D3 w: k- w9 V* J- u
"id" => $shortname."_sponsor_banner_four",3 }( L/ Z2 f& _2 f& m
"type" => "textarea",5 |! A' c1 P" f9 V' R3 A1 S M
"std" => "",
! P9 C1 R8 A/ M; A+ i; M$ a ),
) n2 N; ~& v2 }: R0 T5 ^! @4 z' s( I$ |+ N" ~+ c1 h) S r
array( "name" => "Insert Sponsor Banner Five HTML Code<br /><em>*leave blank if not use</em>",' e7 q! I/ V" H" p% ], U
"id" => $shortname."_sponsor_banner_five",1 `# _( P" N9 e( n* f
"type" => "textarea",
3 C+ F8 T1 |" ^/ V, d5 C( f "std" => "",+ q8 W) L/ r$ p3 a1 Z( L
),1 O3 @9 u& W$ q& e
& J7 d$ f# t3 T, F
array( "name" => "Insert Sponsor Banner Six HTML Code<br /><em>*leave blank if not use</em>",
5 z1 ~ `; a3 s4 y+ i "id" => $shortname."_sponsor_banner_six",3 H9 Y9 F% a0 ^# ]0 U
"type" => "textarea",4 Y& y0 a3 n; S. i( q9 Y
"std" => "",6 t: w% l# |. S
),! w. R+ @1 X' g2 L4 g4 M- I2 @
1 `. B( a% w) X# p# f7 l2 L
array( "name" => "</div></div>",
7 J/ L8 p7 v2 G# m "type" => "close",
u9 _- b- c0 ^5 n ),
2 L: c& A4 Y( J; N
+ |/ P: B" e) g; S$ x$ E& i1 a. I
! ^0 L2 Y1 m. P
+ K! M9 M( {5 d! l) p8 a7 B);( N, [& e! p: p) F& g# U
' S/ w7 r. u% i) e) R$ Y$ {
function mytheme_admin_panel(){ if ((function_exists("check_theme_footer") || function_exists("check_theme_header"))) {; c4 x, Z: A# n" ?1 c# I2 a4 l4 A
: [0 m8 l1 ]4 w$ necho "<div id=\"admin-options\"> ";
) \% Z; j0 J) `9 W" E3 v4 c: O# v% w C& O; p
global $themename, $shortname, $options;
4 w, S; E( y$ b; b; r, Q" Z" mif ( $_REQUEST['saved'] ) echo '<div id="update-option" class="updated fade"><strong>'.$themename.' settings saved.</strong></div>';) f# h& R/ M% V8 @" j7 U
if ( $_REQUEST['reset'] ) echo '<div id="update-option" class="updated fade"><strong>'.$themename.' settings reset.</strong></div>';
+ O) ^4 P0 S* O) z% T3 ??>- X# P }8 X) j& E
6 @- N3 t3 `- w9 [: d5 P: s<h4><?php echo "$themename"; ?> Theme Options</h4>
; ^+ |$ Z/ ~, P! l8 Q R3 v
6 S* c. V# k# ^3 L<div class="annouce">% Z0 q0 r E3 B: v. y+ d0 z7 E: v
<h1>Thank You Using Our <?php echo "$themename"; ?> WordPress Theme</h1>" Z! \* t' S- D; ]: j4 y! e
<p>Don't Forget to <a href="http://feedburner.google.com/fb/a/mailverify?uri=MagPress&loc=en_US" title="MagPress Newsletter" target="_blank" rel="nofollow"><b>Subscribe Our Free NewsLetter</b></a> In Order To Receive Theme's Updates and Fixes.</p>
* U5 l9 }9 z7 M</div>4 M1 W5 `& O! y) X5 k) |* c
4 p8 ^' o, K3 `. C! e& _ D
<form action="" method="post">& q9 X+ b4 K) q! k
. f) l% q' S( q5 I. X4 P& [; I, H<?php foreach ($options as $value) { ?>
* S$ N4 i b4 P! Y( a0 }# o2 w1 n* y
<?php switch ( $value['type'] ) { case 'heading': ?>/ n$ e0 N6 z7 X+ n# }0 V2 x
3 X; U$ _' j5 y6 `, u3 u; ^
<div class="get-option">
" b8 S$ g% v8 {& x# Z+ U+ @ `1 `: B& Q; d4 I8 J; ?
<h2><?php echo $value['name']; ?></h2>$ m% O3 r+ S1 G" l9 T! \$ p& V
5 g7 }* `4 e: q, J3 O# v" v0 D" ?<div class="option-save">+ C: A' K0 L. k ]* ]! m! D
9 c) e! P8 }; ^; Q/ `
<?php
5 X u" Y8 j8 t( abreak;
2 {6 C. A' o% J! S0 rcase 'text':
+ [- e8 @0 E2 h: ~+ X$ C?>3 j+ U) f/ |% _* A9 _/ O' x
1 N. T. r9 S. E* L, m1 l& R
<div class="description"><?php echo $value['name']; ?></div>
. T$ n8 f. k) D8 k5 F/ W<p><input name="<?php echo $value['id']; ?>" class="myfield" id="<?php echo $value['id']; ?>" type="<?php echo $value['type']; ?>" value="<?php if (
6 N/ S; | b, N
$ J" T- k. x; v( K7 Q6 kget_settings( $value['id'] ) != "") { echo get_settings( $value['id'] ); } else { echo $value['std']; } ?>" /></p> W# c) u3 \4 C. _5 ~' D% q( J
7 W1 {, g' G |# Q$ s3 O<?php# f/ C8 e# Y$ t
break;
. G! d C+ A* w* h! C. scase 'select':
% Z, O7 C2 E( B& t) H4 l?>
* x6 J, a, E+ D. X+ g$ J4 w/ B# A9 ? a8 c
<div class="description"><?php echo $value['name']; ?></div>" H* c7 v2 Y5 |! [: e) Y3 x
<p><select name="<?php echo $value['id']; ?>" class="myselect" id="<?php echo $value['id']; ?>">
5 n* X6 G* P. ?4 c4 Z8 n& V+ ~<?php foreach ($value['options'] as $option) { ?>
4 t/ @4 M# m, R8 q<option<?php if ( get_settings( $value['id'] ) == $option) { echo ' selected="selected"'; } elseif ($option == $value['std']) { echo ' selected="selected"'; } ?>><?php echo $option; ?></option>8 g" v% r0 R4 U( x3 s$ b2 t4 R
<?php } ?>
g% m, O+ O0 u# P; B( K</select>2 s3 I9 P+ ^2 b7 ?5 s, t
</p>
. Z$ W K0 O; X2 e I- }( N" S
, [8 H7 F! T* g$ Q<?php
- U! |5 U% @8 S; c' P, pbreak;
. N0 e6 |4 z0 P1 ~! i( `case 'textarea':& O6 h, n( t1 H
$valuex = $value['id'];; B l8 B. X+ z0 {- M+ [2 {
$valuey = stripslashes($valuex);: _" d9 g3 Y! {7 u
$video_code = get_settings($valuey);
7 [, q2 [& }$ H( T?>
; `1 f# L3 `+ B& ` m
9 x D3 n: M* D/ B4 U# u+ T<div class="description"><?php echo $value['name']; ?></div>
2 O; I) S& w+ L+ A) [% e: r& X" G<p><textarea name="<?php echo $valuey; ?>" class="mytext" cols="40%" rows="8" /><?php if ( get_settings($valuey) != "") { echo stripslashes($video_code); }/ S9 P5 K9 `& ]8 ~* `0 I0 X5 A
7 e9 A' C9 {( t) p6 a- h3 o- Q1 d% G3 `9 d
else { echo $value['std']; } ?></textarea></p>
# l+ v0 `% c w# H4 C% B( A" B+ @* q; ?; N) R
<?php
; i. G/ X' v; j- R% ~break;
1 S+ g6 W& I8 `3 c5 c0 s* ]case 'close':
$ k( c7 Z" b% m, S$ @1 F+ r) S?>
. W# M$ ]" M: m0 Y( i
) b& P( G( ^* y& v<div class="clearfix"></div>" n" K8 a+ h* M- y/ i
</div><!-- OPTION SAVE END -->
`, c+ e4 E6 Y7 T; m/ @: p' t; L- I5 y" j' Q7 c% W5 e, R. i- z
<div class="clearfix"></div>
) ~% s4 M4 B) I1 G</div><!-- GET OPTION END -->
) g2 h$ w2 R8 m
2 u, g; P( U7 k4 i# ~0 ] Z5 y<?php
% g, Q5 N ]& J8 jbreak;9 F4 L9 s- E2 P' W! @, J3 g& I+ {: L
default;- s, A7 W Q' h4 e9 @ X
?>
+ D( E7 [# o9 O
1 j! p1 r$ f; V6 Q, @' A) b/ B2 S, ]9 r4 p* s9 f% P% M
<?php& |7 Q6 W/ o/ @9 M( T$ ?
break; } ?>
( V3 d8 Z& a6 Q/ f8 I# c. r4 z, ^3 v# d- T; G+ }
<?php } ?>4 d4 I7 m$ O- f( F- L- j5 M" Z
7 _/ P: F6 M7 P3 `<p class="save-p">
- i! p: z- s8 o: ~4 `2 z<input name="save" type="submit" class="sbutton" value="Save Options" />( \ Q% ]2 K2 r& t3 B5 m' I
<input type="hidden" name="action" value="save" />
& x- u& ~( { F: r! Q/ b9 \0 V' V</p>
( |+ J5 p0 J* I X; o3 p# h</form>: `5 c4 n! z/ G
; r9 \+ ^+ E9 I% B+ E<form method="post">7 k. O# |- D8 k- j* Z ~3 Y
<p class="save-p">6 J: |9 ~0 E6 K1 V6 x" \
<input name="reset" type="submit" class="sbutton" value="Reset Options" />
! H; f0 g$ K% N<input type="hidden" name="action" value="reset" />/ m$ ]4 r* Z0 C# H% h0 R) U
</p>& H) f) L, V& q
</form>& `8 b- n/ C/ R5 u& Y9 [
4 G; p3 X6 @0 G& `) J8 O& m* }% [
</div><!-- ADMIN OPTIONS END -->
" V, b' b! I3 w" \1 b3 D# k; T: t+ b. E, N. z5 X- u2 n9 c% ]
<?php } else { echo ("Well, You Done It..You Just Modified Some Codes!"); } }# {6 v: {, ], w7 M$ N. S* n
* ]$ K3 m: n. V( zfunction mytheme_admin_register() {/ `+ D" O3 D0 b
global $themename, $shortname, $options;% l3 D9 l, M+ j- p2 x
if ( $_GET['page'] == basename(__FILE__) ) {
3 p$ X) h4 I" S* }9 I; oif ( 'save' == $_REQUEST['action'] ) {+ t5 \" c- ~$ C
foreach ($options as $value) {8 ^# ~1 o6 ]8 C D. u6 z1 o- X# O
update_option( $value['id'], $_REQUEST[ $value['id'] ] ); }. I8 Z6 H+ c) F4 n$ \# h: I4 e( p4 p
foreach ($options as $value) {
4 w9 c. i* r# H/ l' h+ Cif( isset( $_REQUEST[ $value['id'] ] ) ) { update_option( $value['id'], $_REQUEST[ $value['id'] ] ); } else { delete_option( $value['id'] ); } }) M+ b& W3 l/ j- B8 j3 [; p; _& E
header("Location: themes.php?page=functions.php&saved=true");1 x# d6 n- W* L
die;0 v4 W; d1 {% [) \
} else if( 'reset' == $_REQUEST['action'] ) {
b% T& G9 x/ F! T; |6 i1 ?$ Cforeach ($options as $value) {: w! f$ m% z d: X4 Q" A1 n9 i
delete_option( $value['id'] ); }& u% L6 z+ f" {; s
header("Location: themes.php?page=functions.php&reset=true");
: V6 i0 {7 f. R1 J3 ~! ^die;
4 v* k) a& F' U) W3 P+ P% e}& i* M' M, z0 i3 D
}2 F) P% C2 o& A8 a( w
add_theme_page($themename." Options", "Theme Options", 'edit_themes', basename(__FILE__), 'mytheme_admin_panel');9 o7 Q; @4 U" E: A
}" F' N/ i% t! D7 a K
& f' F1 f. n: r1 M4 Q! U1 rfunction mytheme_admin_head() { ?>, q$ F) {) Q8 q9 J
<link href="<?php bloginfo('template_directory'); ?>/css/admin-panel.css" rel="stylesheet" type="text/css" />
7 O" `* W5 j* K" I$ y<?php }, }) C; w- l6 o) p C7 T
|
|