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