|
|

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