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