|
|

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