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