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