|
|

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