|
|

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