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