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