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