|
|

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