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