|
|

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