|
|

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