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