|
|

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