|
|

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