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