|
|

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