|
|

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