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