|
|

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