|
|

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