|
|

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