|
|

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