|
|

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