|
|

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