|
|

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