|
|

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